You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
utilus is trying to make styling process easier by hiding away the annoying parts, and adding new features with a nice to use APIs.
You'll get super comfy media queries, awesome flexgrid, and tons of CSS improvements and extensions. utilus also doesn't produce prefixes, that's what autoprefixer is for.
Installation
npm install utilus --save-dev
Usage
From within your styles, load the whole utilus:
@require'utilus'
Or only the modules you are interested in:
@require'utilus/media'@require'utilus/flexgrid'
Examples
Comfy flexible grid system:
.container// define a custom grid for this elementflexgrid: 12columns16pxgutteraround.itemspan: 4/12// span item 4 out of 12 columnsoffset: 4/12// offset item 4 out of 12 columns// save a custom gridutilus.flexgrid.main=flexgrid-type(12columns16pxgutteraround)
.container// and use laterflexgrid: main// or use with some adjustmentsflexgrid: maingutterbetween
Easy media queries:
+media('screen <480px')
color: red// or with a shorthand+screen('<480px')
color: red// or save custom queryutilus.media.mobile=media-query('screen <480px')
// and use later+media('mobile')
color: red
Tons of utility functions and CSS extensions:
clear: fix// output clearfixsize: 100px// set width & height to 100pxsize: 100px60px// set width to 100px and height to 60pxmargin: 5px_10px// set top and bottom margin with underscore omission syntaxpadding: 5px_10px// set top and bottom padding with underscore omission syntaxposition: cover// cover the parent relative elementposition: center// center within parent relative elementabsolute: 5px__10px// position: absolute, top: 5px, left: 10pxoverflow: ellipsis// text ellipsis overflowtransition: all300mseasing('in-quad') // easy easing referenceswidth: rem(100px) // style in `px` and respect the user browser settings at the same time// and more!