-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
components: Remove parts of
@wp-g2
dependencies
- Loading branch information
1 parent
ff22d0a
commit 9293fdd
Showing
18 changed files
with
286 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
// eslint-disable-next-line no-restricted-imports | ||
import type { CSSProperties } from 'react'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import type { Props } from './types'; | ||
import { space } from '../utils/space'; | ||
import { CONFIG } from '../../utils'; | ||
|
||
export function getLineHeight( | ||
adjustLineHeightForInnerControls: Props[ 'adjustLineHeightForInnerControls' ], | ||
lineHeight: CSSProperties[ 'lineHeight' ] | ||
) { | ||
if ( lineHeight ) return lineHeight; | ||
|
||
if ( ! adjustLineHeightForInnerControls ) return; | ||
|
||
let value = `calc(${ CONFIG.controlHeight } + ${ space( 2 ) })`; | ||
|
||
switch ( adjustLineHeightForInnerControls ) { | ||
case 'large': | ||
value = `calc(${ CONFIG.controlHeightLarge } + ${ space( 2 ) })`; | ||
break; | ||
case 'small': | ||
value = `calc(${ CONFIG.controlHeightSmall } + ${ space( 2 ) })`; | ||
break; | ||
case 'xSmall': | ||
value = `calc(${ CONFIG.controlHeightXSmall } + ${ space( 2 ) })`; | ||
break; | ||
default: | ||
break; | ||
} | ||
|
||
return value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.