Size setters
FlatifyCSS is designed based on rem for root and em for each element,
so it is possible to change components size just by changing font-size.
Here is the list of classes to change elements font size to control their size:
| Class | Same as | font-size |
|---|---|---|
.size-xs | .text-xs | 0.75em |
.size-sm | .text-sm | 0.9em |
.size-md | .text-md | 1em |
.size-lg | .text-lg | 1.25em |
.size-2x | .text-2x | 1.5em |
.size-3x | .text-3x | 2.2em |
.size-4x | .text-4x | 2.5em |
.size-5x | .text-5x | 3.14em |
Custom helper classes
Note that these classes can be customized in _config.scss,
there is a variable called $FONT_SIZE_LIST,
These classes are generated from this list.
So it is possible to create customized helper classes for font sizes simply!
For example, this keeps the defaults and adds a .size-custom-largest class:
_config.scss
// This list will be converted to helper classes.
// .size-[] | .text-[]
$FONT_SIZE_LIST: (
xs: 0.75em,
sm: 0.9em,
md: 1em,
lg: 1.25em,
2x: 1.5em,
3x: 2.2em,
4x: 2.5em,
5x: 3.14em,
custom-largest: 8em,
);