- Notifications
You must be signed in to change notification settings - Fork1
LukeAskew/css-utils
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A collection of CSSutility classes - based onEmmet shorthand conventions - to aid inobject-oriented CSS development.
Terse OOCSS classes can be a powerful tool for rapid and scalable development. They can be used independently, or to augment existing objects.
<divclass="card"><divclass="card__photo ta-c"><h3>Business Name</h3><divclass="fz-s">Some City, America</div></div><divclass="card__cell"><h3class="mt-xs mb-xxs">John Doe</h3><divclass="fz-s"><spanclass="fw-b">Member number:</span> 081425</div><divclass="mt mb-l">123 Main St.<br/>Columbus, OH 43215</div><ahref="#"class="button">Select Account</a></div></div>
You candownload the repo, or install viaBower:
$ bower install css-utils --save-dev
| Selector | Responsibility |
|---|---|
.d-b | display block |
.d-i | display inline |
.d-ib | display inline-block |
.d-tb | display table |
.d-tbc | display table-cell |
.d-tbr | display table-row |
.vh | visually hidden, but available for screen readers |
| Selector | Responsibility |
|---|---|
.fl-l | float left |
.fl-r | float right |
.fl-n | float none |
.cl-b | clear both |
.cl-l | clear left |
.cl-r | clear right |
.cf | clear fix (contain floats) |
| Selector | Responsibility |
|---|---|
.rwd-img | responsive image (max-width: 100%) |
.rwd-img-st | stretched responsive image (width: 100%) |
.intrinsic | intrinsic ratio wrapper; default 16:9 ratio |
.ir | image replacement (@mixin included) |
| Selector | Responsibility |
|---|---|
.pos-r | position relative |
.pos-s | position static |
.pos-a | position absolute |
.pos-f | position fixed |
| Selector | Responsibility |
|---|---|
.{p/m}{t/r/b/l}-{xxs/xs/s/l/xl/xxl} | apply padding/margin in a given direction (top/right/bottom/left) in a given increment. |
.{p/m}-0 | remove all padding/margin |
.m{r/l}-a | margin left/right auto (centering) |
| Increment | Value* |
|---|---|
xxs | 0.146em |
xs | 0.236em |
s | 0.618em |
| (none) | 1em |
l | 1.618em |
xl | 4.236em |
xxl | 6.854em |
*values derived fromgolden ratio
Examples:
<divclass="mt-xl"><!-- 4.236em top margin --></div><divclass="pl-s"><!-- 0.618em left padding --></div><divclass="mb"><!-- 1em bottom margin --></div>
The spacing scale and step progression are configurable. Set these values in your own Sass, before including the css-utils lib:
// default values$util-ratio:1.618;$util-base:1em;$util-spacing: (xxs:-4,xs:-3,s:-1,base:0,l:1,xl:3,xxl:4);
| Selector | Responsibility |
|---|---|
.ta-l | text align left |
.ta-c | text align center |
.ta-r | text align right |
.ta-j | text align justify |
.c-i | inherit ancestor text color |
.kern | enable font kerning |
.whs-nw | prevent wrapping on whitespace |
.truncate | limit text to a single line, truncating with an ellipsis |
.fw-l | font weight light (200) |
.fw-n | font weight normal (400) |
.fw-b | font weight bold (700) |
.fs-i | italic |
.tt-u | uppercase |
.wfsm | font anti-aliasing |
| Selector | Responsibility |
|---|---|
.va-t | align to top |
.va-m | align to middle |
.va-b | align to bottom |
About
Emmet-inspired CSS utility classes for rapid website development
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.