Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Emmet-inspired CSS utility classes for rapid website development

NotificationsYou must be signed in to change notification settings

LukeAskew/css-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A collection of CSSutility classes - based onEmmet shorthand conventions - to aid inobject-oriented CSS development.

Usage

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>

Install

You candownload the repo, or install viaBower:

$ bower install css-utils --save-dev

The Classes

Display

SelectorResponsibility
.d-bdisplay block
.d-idisplay inline
.d-ibdisplay inline-block
.d-tbdisplay table
.d-tbcdisplay table-cell
.d-tbrdisplay table-row
.vhvisually hidden, but available for screen readers

Floats

SelectorResponsibility
.fl-lfloat left
.fl-rfloat right
.fl-nfloat none
.cl-bclear both
.cl-lclear left
.cl-rclear right
.cfclear fix (contain floats)

Media

SelectorResponsibility
.rwd-imgresponsive image (max-width: 100%)
.rwd-img-ststretched responsive image (width: 100%)
.intrinsicintrinsic ratio wrapper; default 16:9 ratio
.irimage replacement (@mixin included)

Position

SelectorResponsibility
.pos-rposition relative
.pos-sposition static
.pos-aposition absolute
.pos-fposition fixed

Spacing

SelectorResponsibility
.{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}-0remove all padding/margin
.m{r/l}-amargin left/right auto (centering)
IncrementValue*
xxs0.146em
xs0.236em
s0.618em
(none)1em
l1.618em
xl4.236em
xxl6.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);

Text

SelectorResponsibility
.ta-ltext align left
.ta-ctext align center
.ta-rtext align right
.ta-jtext align justify
.c-iinherit ancestor text color
.kernenable font kerning
.whs-nwprevent wrapping on whitespace
.truncatelimit text to a single line, truncating with an ellipsis
.fw-lfont weight light (200)
.fw-nfont weight normal (400)
.fw-bfont weight bold (700)
.fs-iitalic
.tt-uuppercase
.wfsmfont anti-aliasing

Vertical Alignment

SelectorResponsibility
.va-talign to top
.va-malign to middle
.va-balign to bottom

License

The MIT License (MIT)

About

Emmet-inspired CSS utility classes for rapid website development

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp