Classes designed for easily applying the spacing and alignments without needing to add new classes/modifiers for everything.
yarn add css-utility-classes
They are prefixed with u-
. Classes that may require !important
have an i
suffix.
text-align:
.u-text-right
.u-text-left
.u-text-center
float:
.u-float-right
.u-float-left
.u-float-none
min-height: size is 0 - 200
incrementing up by 5px
-
.mh-#{size}
formargin
,.mh-#{size}i
with!important
margin: size is 0 - 100
incrementing up by 5px
-
.u-m-#{size}
formargin
,.u-m-#{size}i
with!important
(all following classes have the same option) -
.u-mt-#{size}
fortop-margin
-
.u-mr-#{size}
forright-margin
-
.u-mb-#{size}
forbottom-margin
-
.u-ml-#{size}
forleft-margin
-
.u-mx-#{size}
forleft-margin
andright-margin
-
.u-my-#{size}
fortop-margin
andbottom-margin
padding: size is 0 - 100
incrementing up by 5px
-
.u-p-#{size}
forpadding
,.u-p-#{size}i
with!important
(all following classes have the same option) -
.u-pt-#{size}
fortop-padding
-
.u-pr-#{size}
forright-padding
-
.u-pb-#{size}
forbottom-padding
-
.u-pl-#{size}
forleft-padding
-
.u-px-#{size}
forleft-padding
andright-padding
-
.u-py-#{size}
fortop-padding
andbottom-padding
Requires yarn or npm (use yarn don't be dumb).
Setup:
git clone git@github.com:postedin/css-utility-classes.git
yarn setup
Commands:
yarn build
yarn run watch
When committing git hooks will run yarn build
and add the build to the current commit.
Yolo.