Socket
Socket
Sign inDemoInstall

oocss-utils

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    oocss-utils

Object-oriented CSS utility classes for rapid website development


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Install size
15.6 kB
Created
Weekly downloads
 

Readme

Source

CSS Utility Classes Build Status

A collection of CSS utility classes - based on Emmet shorthand conventions - to aid in object-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.

<div class="card">
	<div class="card__photo ta-c">
		<h3>Business Name</h3>
		<div class="fz-s">Some City, America</div>
	</div>
	<div class="card__cell">
		<h3 class="mt-xs mb-xxs">John Doe</h3>
		<div class="fz-s"><span class="fw-b">Member number:</span> 081425</div>
		<div class="mt mb-l">
			123 Main St.<br />
			Columbus, OH 43215
		</div>
		<a href="#" class="button">Select Account</a>
	</div>
</div>

Install

You can download the repo, or install via Bower:

$ 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 from golden ratio

Examples:

<div class="mt-xl">
	<!-- 4.236em top margin -->
</div>

<div class="pl-s">
	<!-- 0.618em left padding -->
</div>

<div class="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)

Keywords

FAQs

Last updated on 10 Nov 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc