Last active
August 29, 2015 14:16
-
-
Save csswizardry/593ccb11e808bbd2922c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p class="u-1/2-md">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ---- | |
| // Sass (v3.4.12) | |
| // Compass (v1.0.3) | |
| // ---- | |
| // _settings.responsive.scss | |
| // Create an array of named breakpoints and their conditions. | |
| $breakpoints: ( | |
| "xs" "screen and (max-width: 44.9375em)", | |
| "sm" "screen and (min-width: 45em) and (max-width: 63.9375em)", | |
| "md" "screen and (min-width: 45em)", | |
| "lg" "screen and (max-width: 63.9375em)", | |
| "xl" "screen and (min-width: 64em)", | |
| ) !default; | |
| // _tools.responsive.scss | |
| // Using our breakpoint settings, allow us to quickly generate complete media | |
| // queries from our aliases. | |
| // | |
| // .simple-usage { | |
| // padding: 1em; | |
| // @include media-query(xl) { | |
| // padding: 2em; | |
| // } | |
| // } | |
| @mixin media-query($mq) { | |
| $breakpoint-found: false; | |
| // Loop through the list of breakpoints we’ve provided in our settings file. | |
| @each $breakpoint in $breakpoints { | |
| // Grab the alias and the condition from their respective locations in | |
| // the list. | |
| $alias: nth($breakpoint, 1); | |
| $condition: nth($breakpoint, 2); | |
| // If the media query we’ve specified has an alias and a condition... | |
| @if ($mq == $alias and $condition) { | |
| // ...tell the mixin that we’ve found it... | |
| $breakpoint-found: true; | |
| // ...and spit it out here. | |
| @media #{$condition} { | |
| @content; | |
| } | |
| } | |
| } | |
| // If the user specifies a non-exitent alias, send them a warning. | |
| @if ($breakpoint-found == false) { | |
| @warn "Oops! Breakpoint ‘#{$mq}’ does not exist." | |
| } | |
| } | |
| // _tools.widths.scss | |
| // Do we want to use classes like `<div class="u-1/4">` instead of | |
| // `<div class="u-1-of-4">`? | |
| $widths-fractions: true !default; | |
| // Depending on what we chose for `$widths-fractions`, create the relevant | |
| // delimiter. | |
| $delimiter: null; | |
| @if ($widths-fractions == true) { | |
| $delimiter: \/; | |
| } @else { | |
| $delimiter: -of-; | |
| } | |
| // 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($columns, $breakpoint: null) { | |
| // Loop through the number of columns for each denominator of our fractions. | |
| @each $denominator in $columns { | |
| // Begin creating a numberator for our fraction up until we hit the | |
| // denominator. | |
| @for $numerator from 1 through $denominator { | |
| // Build a class in the format `.u-3/4` or `.u-3-of-4`. | |
| .u-#{$numerator}#{$delimiter}#{$denominator}#{$breakpoint} { | |
| width: ($numerator / $denominator) * 100% !important; | |
| } | |
| } | |
| } | |
| } | |
| // _trumps.widths.scss | |
| // By default we will create halves, thirds, quarters, and fifths. | |
| $columns: ( | |
| 2, | |
| 3, | |
| 4, | |
| 5 | |
| ) !default; | |
| // Loop through each of our column sizes and generate its width classes. | |
| @each $column in $columns { | |
| @include widths($column); | |
| } | |
| // _trumps.widths-responsive.scss | |
| // Loop over our breakpoints defined in _settings.responsive.scss | |
| @each $breakpoint in $breakpoints { | |
| // Get the name of the breakpoint. | |
| $alias: nth($breakpoint, 1); | |
| @include media-query($alias) { | |
| // Loop through each of our column sizes and generate its responsive width | |
| // classes. | |
| @each $column in $columns { | |
| @include widths($column, -#{$alias}); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .u-1\/2 { | |
| width: 50% !important; | |
| } | |
| .u-2\/2 { | |
| width: 100% !important; | |
| } | |
| .u-1\/3 { | |
| width: 33.33333% !important; | |
| } | |
| .u-2\/3 { | |
| width: 66.66667% !important; | |
| } | |
| .u-3\/3 { | |
| width: 100% !important; | |
| } | |
| .u-1\/4 { | |
| width: 25% !important; | |
| } | |
| .u-2\/4 { | |
| width: 50% !important; | |
| } | |
| .u-3\/4 { | |
| width: 75% !important; | |
| } | |
| .u-4\/4 { | |
| 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; | |
| } | |
| @media screen and (max-width: 44.9375em) { | |
| .u-1\/2-xs { | |
| width: 50% !important; | |
| } | |
| .u-2\/2-xs { | |
| width: 100% !important; | |
| } | |
| .u-1\/3-xs { | |
| width: 33.33333% !important; | |
| } | |
| .u-2\/3-xs { | |
| width: 66.66667% !important; | |
| } | |
| .u-3\/3-xs { | |
| width: 100% !important; | |
| } | |
| .u-1\/4-xs { | |
| width: 25% !important; | |
| } | |
| .u-2\/4-xs { | |
| width: 50% !important; | |
| } | |
| .u-3\/4-xs { | |
| width: 75% !important; | |
| } | |
| .u-4\/4-xs { | |
| width: 100% !important; | |
| } | |
| .u-1\/5-xs { | |
| width: 20% !important; | |
| } | |
| .u-2\/5-xs { | |
| width: 40% !important; | |
| } | |
| .u-3\/5-xs { | |
| width: 60% !important; | |
| } | |
| .u-4\/5-xs { | |
| width: 80% !important; | |
| } | |
| .u-5\/5-xs { | |
| width: 100% !important; | |
| } | |
| } | |
| @media screen and (min-width: 45em) and (max-width: 63.9375em) { | |
| .u-1\/2-sm { | |
| width: 50% !important; | |
| } | |
| .u-2\/2-sm { | |
| width: 100% !important; | |
| } | |
| .u-1\/3-sm { | |
| width: 33.33333% !important; | |
| } | |
| .u-2\/3-sm { | |
| width: 66.66667% !important; | |
| } | |
| .u-3\/3-sm { | |
| width: 100% !important; | |
| } | |
| .u-1\/4-sm { | |
| width: 25% !important; | |
| } | |
| .u-2\/4-sm { | |
| width: 50% !important; | |
| } | |
| .u-3\/4-sm { | |
| width: 75% !important; | |
| } | |
| .u-4\/4-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; | |
| } | |
| } | |
| @media screen and (min-width: 45em) { | |
| .u-1\/2-md { | |
| width: 50% !important; | |
| } | |
| .u-2\/2-md { | |
| width: 100% !important; | |
| } | |
| .u-1\/3-md { | |
| width: 33.33333% !important; | |
| } | |
| .u-2\/3-md { | |
| width: 66.66667% !important; | |
| } | |
| .u-3\/3-md { | |
| width: 100% !important; | |
| } | |
| .u-1\/4-md { | |
| width: 25% !important; | |
| } | |
| .u-2\/4-md { | |
| width: 50% !important; | |
| } | |
| .u-3\/4-md { | |
| width: 75% !important; | |
| } | |
| .u-4\/4-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; | |
| } | |
| } | |
| @media screen and (max-width: 63.9375em) { | |
| .u-1\/2-lg { | |
| width: 50% !important; | |
| } | |
| .u-2\/2-lg { | |
| width: 100% !important; | |
| } | |
| .u-1\/3-lg { | |
| width: 33.33333% !important; | |
| } | |
| .u-2\/3-lg { | |
| width: 66.66667% !important; | |
| } | |
| .u-3\/3-lg { | |
| width: 100% !important; | |
| } | |
| .u-1\/4-lg { | |
| width: 25% !important; | |
| } | |
| .u-2\/4-lg { | |
| width: 50% !important; | |
| } | |
| .u-3\/4-lg { | |
| width: 75% !important; | |
| } | |
| .u-4\/4-lg { | |
| width: 100% !important; | |
| } | |
| .u-1\/5-lg { | |
| width: 20% !important; | |
| } | |
| .u-2\/5-lg { | |
| width: 40% !important; | |
| } | |
| .u-3\/5-lg { | |
| width: 60% !important; | |
| } | |
| .u-4\/5-lg { | |
| width: 80% !important; | |
| } | |
| .u-5\/5-lg { | |
| width: 100% !important; | |
| } | |
| } | |
| @media screen and (min-width: 64em) { | |
| .u-1\/2-xl { | |
| width: 50% !important; | |
| } | |
| .u-2\/2-xl { | |
| width: 100% !important; | |
| } | |
| .u-1\/3-xl { | |
| width: 33.33333% !important; | |
| } | |
| .u-2\/3-xl { | |
| width: 66.66667% !important; | |
| } | |
| .u-3\/3-xl { | |
| width: 100% !important; | |
| } | |
| .u-1\/4-xl { | |
| width: 25% !important; | |
| } | |
| .u-2\/4-xl { | |
| width: 50% !important; | |
| } | |
| .u-3\/4-xl { | |
| width: 75% !important; | |
| } | |
| .u-4\/4-xl { | |
| width: 100% !important; | |
| } | |
| .u-1\/5-xl { | |
| width: 20% !important; | |
| } | |
| .u-2\/5-xl { | |
| width: 40% !important; | |
| } | |
| .u-3\/5-xl { | |
| width: 60% !important; | |
| } | |
| .u-4\/5-xl { | |
| width: 80% !important; | |
| } | |
| .u-5\/5-xl { | |
| width: 100% !important; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p class="u-1/2-md">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment