Skip to main content

CSS PreProcessor

SACSS Core Code has only one CSS file, we provide SASS、 LESS、Stylus Mixin to help you build Utility First CSS quickly.

Why do you need to customize? click me to learn more

Install#

$ npm i sacss

Use#

@import '~sacss/less/WidthPrefix';
@import '~sacss/less/SACSS';
@import "~sacss/less/Helpers";
// This prefix is added to all ClassName (but it is not recommended to add the prefix)
@prefix: '';
// Unit conversion expressions
@unit: 1px;
// Adding prefixes to core code
#WidthPrefix(@prefix);
// margin
#SACSS(@prefix; 'margin-top'; 'mt'; 8, 16; @unit);
#SACSS(@prefix; 'margin-right'; 'mr'; 8, 16; @unit);
#SACSS(@prefix; 'margin-bottom'; 'mb'; 8, 16; @unit);
#SACSS(@prefix; 'margin-left'; 'ml'; 8, 16; @unit);
// padding
#SACSS(@prefix; 'padding-top'; 'pt'; 8, 16; @unit);
#SACSS(@prefix; 'padding-right'; 'pr'; 8, 16; @unit);
#SACSS(@prefix; 'padding-bottom'; 'pb'; 8, 16; @unit);
#SACSS(@prefix; 'padding-left'; 'pl'; 8, 16; @unit);
// font
#SACSS(@prefix; 'font-size'; 'fs'; 12, 16; @unit);
#SACSS(@prefix; 'line-height'; 'lh'; 16, 24; @unit);
// size
#SACSS(@prefix; 'width'; 'w'; 16, 24; @unit);
#SACSS(@prefix; 'height'; 'h'; 16, 24; @unit);
// Helpers
.clearfix{ #Clearfix; }
.ellipsis{ #Ellipsis; }
.cell{ #Cell; }
.ellipsis-mul{ #Ellipsis-multiple; }
.ellipsis-mul._2{ -webkit-line-clamp: 2; }

After npm install, just click on the top right corner of the code example and copy and paste it into the project to use it.

This is all you need to know except for the naming convention, all you need to know about the code.