Custom Token
less
and sass
have the exact same documentation and API, just syntax different implementations.
The core code sacss/index.css
basically holds layout related code. There are only two colors, pure black and pure white, and even the common font-size
related code is not included.
The reason for this is that different designers have different design specifications for different projects, and we recommend combining them with the project for customization.
#
SACSS APIname | explanation | example |
---|---|---|
prefix | class name prefix | '_' |
attribute name | full Style attribute | 'font-size' |
property abbreviations | naming rule-based property abbreviations | 'fs' |
List of values | List of values to be output consecutively | 8,16,24 |
units | All values will be multiplied with units (null means no units are needed) | 1px |
- LESS
- SASS
For naming rules for abbreviations, please click here.
- LESS
- SASS
- Output CSS
This is the same method as SACSS
, just to make it simpler and intuitive to create the CSS code in output
.
If you feel comfortable writing this part of the CSS by hand, you can also write it yourself.
#
Unit Conversions- LESS
- SASS
- Output CSS
If a rem-based conversion of units is required, fill in 1/16*1rem
.
The SACSS method is only available for use with values of numeric type.
For example, font-weight:bold;
cannot be created using SACSS, but font-weight:400;
ok.
#
Project examples- A project design specification: all spacing, font size must be a multiple of 4 and the primary color is red.
- B project design specification: all spacing, font size must be a multiple of 5, and the primary color is blue;
- A ้กน็ฎ LESS
- A ้กน็ฎ SASS
- B ้กน็ฎ LESS
- B ้กน็ฎ SASS
#
What to customizemargin
: abbreviationm
padding
: abbreviationp
font-size
: abbreviationfs
line-height
: abbreviationlh
color
: abbreviationc_
background-color
: abbreviationbc_
- The Token you communicate with the designer (the agreement between you and the designer)