Classes designed for easily applying the spacing and alignments without needing to add new classes/modifiers for everything.
yarn add css-utility
Classes that may require !important
have an i
suffix.
Classes that may require %
have an p
suffix.
text-align:
.text-right
.text-left
.text-center
float:
.float-right
.float-left
.float-none
display:
.d-{property}
position:
.p-{property}
cursor:
.c-{property}
font-weight:
fw-b
forfont-weight
withbold
fw-n
forfont-weight
withnormal
font-size: size is :medium| xx-small| x-small| small| large| x-large| xx-large| smaller| larger| length| initial| inherit
and 0-100
fs-xx-#{size}
forfont-size
width: size is 0-100
w-#{size}
forwidth
w-#{size}-i
forwidth
with!important
w-#{size}-p
forwidth
with%
w-#{size}-p-i
forwidth
with%
and!important
height: size is 0-100
w-#{size}
forheight
w-#{size}-i
forheight
with!important
w-#{size}-p
forheight
with%
w-#{size}-p-i
forheight
with%
and!important
min-height: size is 0 - 200
incrementing up by 5%
.mh-#{size}-p
formargin
,.mh-#{size}-p-i
with!important
margin: size is 0 - 100
.m-#{size}-p
formargin
,.m-#{size}-p-i
with!important
(all following classes have the same option).mt-#{size}-p
fortop-margin
.mr-#{size}-p
forright-margin
.mb-#{size}-p
forbottom-margin
.ml-#{size}-p
forleft-margin
.mx-#{size}-p
forleft-margin
andright-margin
.my-#{size}-p
fortop-margin
andbottom-margin
padding: size is 0 - 100
.p-#{size}-p
forpadding
,.p-#{size}-p-i
with!important
(all following classes have the same option).pt-#{size}-p
fortop-padding
.pr-#{size}-p
forright-padding
.pb-#{size}-p
forbottom-padding
.pl-#{size}-p
forleft-padding
.px-#{size}-p
forleft-padding
andright-padding
.py-#{size}-p
fortop-padding
andbottom-padding
margin: size is 0 - 100
.m-#{size}
formargin
,.m-#{size}-i
with!important
(all following classes have the same option).mt-#{size}
fortop-margin
.mr-#{size}
forright-margin
.mb-#{size}
forbottom-margin
.ml-#{size}
forleft-margin
.mx-#{size}
forleft-margin
andright-margin
.my-#{size}
fortop-margin
andbottom-margin
padding: size is 0 - 100
.p-#{size}
forpadding
,.p-#{size}-i
with!important
(all following classes have the same option).pt-#{size}
fortop-padding
.pr-#{size}
forright-padding
.pb-#{size}
forbottom-padding
.pl-#{size}
forleft-padding
.px-#{size}
forleft-padding
andright-padding
.py-#{size}
fortop-padding
andbottom-padding
border-radius: size is 0 - 50
incrementing up by 1
.b-r-#{size}
forborder-radius
,.mh-#{size}-i
with!important
.b-r-#{size}-p
forborder-radius
,.mh-#{size}-p-i
with!important
border-style:
.#{style}
forborder-style
Requires yarn or npm (use yarn don't be dumb).
Setup:
git clone [email protected]:samaswin87/css-utility.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.