Skip to content

Instantly share code, notes, and snippets.

@csswizardry
Last active August 29, 2015 14:28
Show Gist options
  • Select an option

  • Save csswizardry/40091c6e8bc0403bf22c to your computer and use it in GitHub Desktop.

Select an option

Save csswizardry/40091c6e8bc0403bf22c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<ul class="o-list-bare">
<li>Lorem ipsum</li>
<li>Dolor sit</li>
<li>Amet consectetur</li>
<li>Adipisci velit</li>
</ul>
<hr />
<ul class="o-list-inline">
<li class="o-list-inline__item">Lorem ipsum</li>
<li class="o-list-inline__item">Dolor sit</li>
<li class="o-list-inline__item">Amet consectetur</li>
<li class="o-list-inline__item">Adipisci velit</li>
</ul>
<hr />
<ul class="o-list-fit">
<li class="o-list-fit__item">Lorem ipsum</li>
<li class="o-list-fit__item">Dolor sit</li>
<li class="o-list-fit__item">Amet consectetur</li>
<li class="o-list-fit__item">Adipisci velit</li>
</ul>
<hr />
<ul class="o-list-fit o-list-fit--equal">
<li class="o-list-fit__item">Lorem ipsum</li>
<li class="o-list-fit__item">Dolor sit</li>
<li class="o-list-fit__item">Amet consectetur</li>
<li class="o-list-fit__item">Adipisci velit</li>
</ul>
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
/*------------------------------------*\
#WIDTHS
\*------------------------------------*/
// A mixin to spit out our width classes. Pass in the columns we want the widths
// to have, and an optional suffix for responsive widths. E.g. to create thirds
// and quarters for a small breakpoint:
//
// @include widths(3 4, -sm);
@mixin widths($widths-columns, $widths-breakpoint: null) {
// Loop through the number of columns for each denominator of our fractions.
@each $widths-denominator in $widths-columns {
// Begin creating a numerator for our fraction up until we hit the
// denominator.
@for $widths-numerator from 1 through $widths-denominator {
// Build a class in the format `.u-3/4`.
.u-#{$widths-numerator}\/#{$widths-denominator}#{$widths-breakpoint} {
width: ($widths-numerator / $widths-denominator) * 100% !important;
}
}
}
}
/**
* A series of width helper classes that you can use to size things like grid
* systems. Classes take a fraction-like format (e.g. `.u-2/3`).
*
* Use these in your markup:
*
* <div class="u-7/12">
*/
@include widths(2 5 7 9);
@media screen and (min-width: 720px) {
@include widths(2 5 7 9, \@sm);
}
@media screen and (min-width: 1024px) {
@include widths(2 5 7 9, \@md);
}
/*------------------------------------*\
#WIDTHS
\*------------------------------------*/
/**
* A series of width helper classes that you can use to size things like grid
* systems. Classes take a fraction-like format (e.g. `.u-2/3`).
*
* Use these in your markup:
*
* <div class="u-7/12">
*/
.u-1\/2 {
width: 50% !important;
}
.u-2\/2 {
width: 100% !important;
}
.u-1\/5 {
width: 20% !important;
}
.u-2\/5 {
width: 40% !important;
}
.u-3\/5 {
width: 60% !important;
}
.u-4\/5 {
width: 80% !important;
}
.u-5\/5 {
width: 100% !important;
}
.u-1\/7 {
width: 14.28571% !important;
}
.u-2\/7 {
width: 28.57143% !important;
}
.u-3\/7 {
width: 42.85714% !important;
}
.u-4\/7 {
width: 57.14286% !important;
}
.u-5\/7 {
width: 71.42857% !important;
}
.u-6\/7 {
width: 85.71429% !important;
}
.u-7\/7 {
width: 100% !important;
}
.u-1\/9 {
width: 11.11111% !important;
}
.u-2\/9 {
width: 22.22222% !important;
}
.u-3\/9 {
width: 33.33333% !important;
}
.u-4\/9 {
width: 44.44444% !important;
}
.u-5\/9 {
width: 55.55556% !important;
}
.u-6\/9 {
width: 66.66667% !important;
}
.u-7\/9 {
width: 77.77778% !important;
}
.u-8\/9 {
width: 88.88889% !important;
}
.u-9\/9 {
width: 100% !important;
}
@media screen and (min-width: 720px) {
.u-1\/2\@sm {
width: 50% !important;
}
.u-2\/2\@sm {
width: 100% !important;
}
.u-1\/5\@sm {
width: 20% !important;
}
.u-2\/5\@sm {
width: 40% !important;
}
.u-3\/5\@sm {
width: 60% !important;
}
.u-4\/5\@sm {
width: 80% !important;
}
.u-5\/5\@sm {
width: 100% !important;
}
.u-1\/7\@sm {
width: 14.28571% !important;
}
.u-2\/7\@sm {
width: 28.57143% !important;
}
.u-3\/7\@sm {
width: 42.85714% !important;
}
.u-4\/7\@sm {
width: 57.14286% !important;
}
.u-5\/7\@sm {
width: 71.42857% !important;
}
.u-6\/7\@sm {
width: 85.71429% !important;
}
.u-7\/7\@sm {
width: 100% !important;
}
.u-1\/9\@sm {
width: 11.11111% !important;
}
.u-2\/9\@sm {
width: 22.22222% !important;
}
.u-3\/9\@sm {
width: 33.33333% !important;
}
.u-4\/9\@sm {
width: 44.44444% !important;
}
.u-5\/9\@sm {
width: 55.55556% !important;
}
.u-6\/9\@sm {
width: 66.66667% !important;
}
.u-7\/9\@sm {
width: 77.77778% !important;
}
.u-8\/9\@sm {
width: 88.88889% !important;
}
.u-9\/9\@sm {
width: 100% !important;
}
}
@media screen and (min-width: 1024px) {
.u-1\/2\@md {
width: 50% !important;
}
.u-2\/2\@md {
width: 100% !important;
}
.u-1\/5\@md {
width: 20% !important;
}
.u-2\/5\@md {
width: 40% !important;
}
.u-3\/5\@md {
width: 60% !important;
}
.u-4\/5\@md {
width: 80% !important;
}
.u-5\/5\@md {
width: 100% !important;
}
.u-1\/7\@md {
width: 14.28571% !important;
}
.u-2\/7\@md {
width: 28.57143% !important;
}
.u-3\/7\@md {
width: 42.85714% !important;
}
.u-4\/7\@md {
width: 57.14286% !important;
}
.u-5\/7\@md {
width: 71.42857% !important;
}
.u-6\/7\@md {
width: 85.71429% !important;
}
.u-7\/7\@md {
width: 100% !important;
}
.u-1\/9\@md {
width: 11.11111% !important;
}
.u-2\/9\@md {
width: 22.22222% !important;
}
.u-3\/9\@md {
width: 33.33333% !important;
}
.u-4\/9\@md {
width: 44.44444% !important;
}
.u-5\/9\@md {
width: 55.55556% !important;
}
.u-6\/9\@md {
width: 66.66667% !important;
}
.u-7\/9\@md {
width: 77.77778% !important;
}
.u-8\/9\@md {
width: 88.88889% !important;
}
.u-9\/9\@md {
width: 100% !important;
}
}
<ul class="o-list-bare">
<li>Lorem ipsum</li>
<li>Dolor sit</li>
<li>Amet consectetur</li>
<li>Adipisci velit</li>
</ul>
<hr />
<ul class="o-list-inline">
<li class="o-list-inline__item">Lorem ipsum</li>
<li class="o-list-inline__item">Dolor sit</li>
<li class="o-list-inline__item">Amet consectetur</li>
<li class="o-list-inline__item">Adipisci velit</li>
</ul>
<hr />
<ul class="o-list-fit">
<li class="o-list-fit__item">Lorem ipsum</li>
<li class="o-list-fit__item">Dolor sit</li>
<li class="o-list-fit__item">Amet consectetur</li>
<li class="o-list-fit__item">Adipisci velit</li>
</ul>
<hr />
<ul class="o-list-fit o-list-fit--equal">
<li class="o-list-fit__item">Lorem ipsum</li>
<li class="o-list-fit__item">Dolor sit</li>
<li class="o-list-fit__item">Amet consectetur</li>
<li class="o-list-fit__item">Adipisci velit</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment