Skip to content

Instantly share code, notes, and snippets.

@sunwoo0706
Last active January 3, 2022 08:57
Show Gist options
  • Save sunwoo0706/f5562efafa91f7d08d17e26341c850b2 to your computer and use it in GitHub Desktop.
Save sunwoo0706/f5562efafa91f7d08d17e26341c850b2 to your computer and use it in GitHub Desktop.
css font-size units type
type cssFontAbsoluteLengthUnitTokens = 'cm' | 'mm' | 'in' | 'px' | 'pt' | 'pc';
type cssFontRelativeLengthUnitTokens = 'em' | 'ex' | 'ch' | 'rem' | 'vw' | 'vmin' | 'vmax' | '%';
type cssFontContextUnitTokens = 'medium' | 'xx-small' | 'x-small' | 'small' | 'large' | 'x-large' | 'xx-large' | 'initial';
type cssFontUnitType = `${number}${cssFontAbsoluteLengthUnitTokens | cssFontRelativeLengthUnitTokens}` | cssFontContextUnitTokens;
interface example {
fontSize: cssFontUnitType;
}
@sunwoo0706
Copy link
Author

sunwoo0706 commented Jan 2, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment