Created
May 19, 2015 15:56
-
-
Save stevenadams/8e471e1ba1d049f3b110 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
// ---- | |
// libsass (v3.2.4) | |
// ---- | |
/*------------------------------------*\ | |
$CSSWIZARDRY-GRIDS | |
\*------------------------------------*/ | |
/** | |
* CONTENTS | |
* INTRODUCTION.........How the grid system works. | |
* VARIABLES............Your settings. | |
* MIXINS...............Library mixins. | |
* GRID SETUP...........Build the grid structure. | |
* WIDTHS...............Build our responsive widths around our breakpoints. | |
* PUSH.................Push classes. | |
* PULL.................Pull classes. | |
*/ | |
/*------------------------------------*\ | |
$INTRODUCTION | |
\*------------------------------------*/ | |
/** | |
* csswizardry grids provides you with widths to suit a number of breakpoints | |
* designed around devices of a size you specify. Out of the box, csswizardry | |
* grids caters to the following types of device: | |
* | |
* palm -- palm-based devices, like phones and small tablets | |
* lap -- lap-based devices, like iPads or laptops | |
* portable -- all of the above | |
* desk -- stationary devices, like desktop computers | |
* regular -- any/all types of device | |
* | |
* These namespaces are then used in the library to give you the ability to | |
* manipulate your layouts based around them, for example: | |
* | |
<div class="grid__item one-whole lap--one-half desk--one-third"> | |
* | |
* This would give you a grid item which is 100% width unless it is on a lap | |
* device, at which point it become 50% wide, or it is on a desktop device, at | |
* which point it becomes 33.333% width. | |
* | |
* csswizardry grids also has push and pull classes which allow you to nudge | |
* grid items left and right by a defined amount. These follow the same naming | |
* convention as above, but are prepended by either `push--` or `pull--`, for | |
* example: | |
* | |
`class="grid__item one-half push--one-half"` | |
* | |
* This would give you a grid item which is 50% width and pushed over to the | |
* right by 50%. | |
* | |
* All classes in csswizardry grids follow this patten, so you should fairly | |
* quickly be able to piece together any combinations you can imagine, for | |
* example: | |
* | |
`class="grid__item one-whole lap--one-half desk--one-third push--desk--one-third"` | |
* | |
`class="grid__item one-quarter palm--one-half push--palm--one-half"` | |
* | |
`class="grid__item palm--one-third desk--five-twelfths"` | |
*/ | |
/*------------------------------------*\ | |
$VARIABLES | |
\*------------------------------------*/ | |
/** | |
* If you are building a non-responsive site but would still like to use | |
* csswizardry-grids, set this to ‘false’: | |
*/ | |
$responsive: true !default; | |
/** | |
* Is this build mobile first? Setting to ‘true’ means that all grids will be | |
* 100% width if you do not apply a more specific class to them. | |
*/ | |
$mobile-first: true !default; | |
/** | |
* Set the spacing between your grid items. | |
*/ | |
$gutter: 24px !default; | |
/** | |
* Would you like Sass’ silent classes, or regular CSS classes? | |
*/ | |
$use-silent-classes: false !default; | |
/** | |
* Would you like push and pull classes enabled? | |
*/ | |
$push: false !default; | |
$pull: false !default; | |
/** | |
* Using `inline-block` means that the grid items need their whitespace removing | |
* in order for them to work correctly. Set the following to true if you are | |
* going to achieve this by manually removing/commenting out any whitespace in | |
* your HTML yourself. | |
* | |
* Setting this to false invokes a hack which cannot always be guaranteed, | |
* please see the following for more detail: | |
* | |
* github.com/csswizardry/csswizardry-grids/commit/744d4b23c9d2b77d605b5991e54a397df72e0688 | |
* github.com/csswizardry/inuit.css/issues/170#issuecomment-14859371 | |
*/ | |
$use-markup-fix: true !default; | |
/** | |
* Define your breakpoints. The first value is the prefix that shall be used for | |
* your classes (e.g. `.palm--one-half`), the second value is the media query | |
* that the breakpoint fires at. | |
*/ | |
$breakpoints: ( | |
's' '(max-width: 480px)', | |
'm' '(min-width: 481px) and (max-width: 1023px)', | |
'l' '(max-width: 1023px)', | |
'xl' '(min-width: 1024px)' | |
) !default; | |
/** | |
* Define which namespaced breakpoints you would like to generate for each of | |
* widths, push and pull. This is handy if you only need pull on, say, desk, or | |
* you only need a new width breakpoint at mobile sizes. It allows you to only | |
* compile as much CSS as you need. All are turned on by default, but you can | |
* add and remove breakpoints at will. | |
* | |
* Push and pull shall only be used if `$push` and/or `$pull` and `$responsive` | |
* have been set to ‘true’. | |
*/ | |
$breakpoint-has-widths: ('s', 'm', 'l', 'xl') !default; | |
$breakpoint-has-push: ('s', 'm', 'l', 'xl') !default; | |
$breakpoint-has-pull: ('s', 'm', 'l', 'xl') !default; | |
/** | |
* You do not need to edit anything from this line onward; csswizardry-grids is | |
* good to go. Happy griddin’! | |
*/ | |
$class-type: if($use-silent-classes, unquote("%"), unquote(".")); | |
/*------------------------------------*\ | |
$MIXINS | |
\*------------------------------------*/ | |
/** | |
* These mixins are for the library to use only, you should not need to modify | |
* them at all. | |
* | |
* Enclose a block of code with a media query as named in `$breakpoints`. | |
*/ | |
@mixin grid-media-query($media-query) { | |
$breakpoint-found: false; | |
@each $breakpoint in $breakpoints { | |
$name: nth($breakpoint, 1); | |
$declaration: nth($breakpoint, 2); | |
@if $media-query == $name and $declaration { | |
$breakpoint-found: true; | |
@media only screen and #{$declaration} { | |
@content; | |
} | |
} | |
} | |
@if not $breakpoint-found { | |
@warn "Breakpoint ‘#{$media-query}’ does not exist"; | |
} | |
} | |
/** | |
* Drop relative positioning into silent classes which can’t take advantage of | |
* the `[class*="push--"]` and `[class*="pull--"]` selectors. | |
*/ | |
@mixin silent-relative { | |
@if $use-silent-classes { | |
position:relative; | |
} | |
} | |
/*------------------------------------*\ | |
$GRID SETUP | |
\*------------------------------------*/ | |
/** | |
* 1. Allow the grid system to be used on lists. | |
* 2. Remove any margins and paddings that might affect the grid system. | |
* 3. Apply a negative `margin-left` to negate the columns’ gutters. | |
*/ | |
#{$class-type}grid { | |
list-style:none; /* [1] */ | |
margin:0; /* [2] */ | |
padding:0; /* [2] */ | |
margin-left:-$gutter; /* [3] */ | |
@if not $use-markup-fix { | |
letter-spacing:-0.31em; | |
} | |
} | |
@if not $use-markup-fix { | |
/* Opera hack */ | |
.opera:-o-prefocus, | |
#{$class-type}grid { | |
word-spacing:-0.43em; | |
} | |
} | |
/** | |
* 1. Cause columns to stack side-by-side. | |
* 2. Space columns apart. | |
* 3. Align columns to the tops of each other. | |
* 4. Full-width unless told to behave otherwise. | |
* 5. Required to combine fluid widths and fixed gutters. | |
*/ | |
#{$class-type}grid__item { | |
display:inline-block; /* [1] */ | |
padding-left:$gutter; /* [2] */ | |
vertical-align:top; /* [3] */ | |
@if $mobile-first { | |
width:100%; /* [4] */ | |
} | |
-webkit-box-sizing:border-box; /* [5] */ | |
-moz-box-sizing:border-box; /* [5] */ | |
box-sizing:border-box; /* [5] */ | |
@if not $use-markup-fix { | |
letter-spacing:normal; | |
word-spacing:normal; | |
} | |
} | |
/** | |
* Reversed grids allow you to structure your source in the opposite order to | |
* how your rendered layout will appear. Extends `.grid`. | |
*/ | |
#{$class-type}grid--rev { | |
direction:rtl; | |
text-align:left; | |
> #{$class-type}grid__item { | |
direction:ltr; | |
text-align:left; | |
} | |
} | |
/** | |
* Gutterless grids have all the properties of regular grids, minus any spacing. | |
* Extends `.grid`. | |
*/ | |
#{$class-type}grid--full { | |
margin-left:0; | |
> #{$class-type}grid__item { | |
padding-left:0; | |
} | |
} | |
/** | |
* Align the entire grid to the right. Extends `.grid`. | |
*/ | |
#{$class-type}grid--right { | |
text-align:right; | |
> #{$class-type}grid__item { | |
text-align:left; | |
} | |
} | |
/** | |
* Centered grids align grid items centrally without needing to use push or pull | |
* classes. Extends `.grid`. | |
*/ | |
#{$class-type}grid--center { | |
text-align:center; | |
> #{$class-type}grid__item { | |
text-align:left; | |
} | |
} | |
/** | |
* Align grid cells vertically (`.grid--middle` or `.grid--bottom`). Extends | |
* `.grid`. | |
*/ | |
#{$class-type}grid--middle { | |
> #{$class-type}grid__item { | |
vertical-align:middle; | |
} | |
} | |
#{$class-type}grid--bottom { | |
> #{$class-type}grid__item { | |
vertical-align:bottom; | |
} | |
} | |
/** | |
* Create grids with narrower gutters. Extends `.grid`. | |
*/ | |
#{$class-type}grid--narrow { | |
margin-left:-($gutter / 2); | |
> #{$class-type}grid__item { | |
padding-left:$gutter / 2; | |
} | |
} | |
/** | |
* Create grids with wider gutters. Extends `.grid`. | |
*/ | |
#{$class-type}grid--wide { | |
margin-left:-($gutter * 2); | |
> #{$class-type}grid__item { | |
padding-left:$gutter * 2; | |
} | |
} | |
/*------------------------------------*\ | |
$WIDTHS | |
\*------------------------------------*/ | |
/** | |
* Create our width classes, prefixed by the specified namespace. | |
*/ | |
@mixin device-type($namespace:"") { | |
$prefix: $class-type + $namespace; | |
/** | |
* Whole | |
*/ | |
#{$prefix}row { width:100%; } | |
/** | |
* Halves | |
*/ | |
#{$prefix}half { width:50%; } | |
/** | |
* Thirds | |
*/ | |
#{$prefix}1-3 { width:33.333%; } | |
#{$prefix}2-3 { width:66.666%; } | |
/** | |
* Quarters | |
*/ | |
#{$prefix}1-4 { width:25%; } | |
#{$prefix}2-4 { @extend #{$prefix}one-half; } | |
#{$prefix}3-4 { width:75%; } | |
/** | |
* Fifths | |
*/ | |
#{$prefix}1-5 { width:20%; } | |
#{$prefix}2-5 { width:40%; } | |
#{$prefix}3-5 { width:60%; } | |
#{$prefix}4-5 { width:80%; } | |
/** | |
* Sixths | |
*/ | |
#{$prefix}1-6 { width:16.666%; } | |
#{$prefix}2-6 { @extend #{$prefix}one-third; } | |
#{$prefix}3-6 { @extend #{$prefix}one-half; } | |
#{$prefix}4-6 { @extend #{$prefix}two-thirds; } | |
#{$prefix}5-6 { width:83.333%; } | |
/** | |
* Eighths | |
*/ | |
#{$prefix}1-8 { width:12.5%; } | |
#{$prefix}2-8 { @extend #{$prefix}one-quarter; } | |
#{$prefix}3-8 { width:37.5%; } | |
#{$prefix}4-8 { @extend #{$prefix}one-half; } | |
#{$prefix}5-8 { width:62.5%; } | |
#{$prefix}6-8 { @extend #{$prefix}three-quarters; } | |
#{$prefix}7-8 { width:87.5%; } | |
/** | |
* Tenths | |
*/ | |
#{$prefix}1-10 { width:10%; } | |
#{$prefix}2-10 { @extend #{$prefix}one-fifth; } | |
#{$prefix}3-10 { width:30%; } | |
#{$prefix}4-10 { @extend #{$prefix}two-fifths; } | |
#{$prefix}5-10 { @extend #{$prefix}one-half; } | |
#{$prefix}6-10 { @extend #{$prefix}three-fifths; } | |
#{$prefix}7-10 { width:70%; } | |
#{$prefix}8-10 { @extend #{$prefix}four-fifths; } | |
#{$prefix}9-10 { width:90%; } | |
/** | |
* Twelfths | |
*/ | |
#{$prefix}1-12 { width:8.333%; } | |
#{$prefix}2-12 { @extend #{$prefix}one-sixth; } | |
#{$prefix}3-12 { @extend #{$prefix}one-quarter; } | |
#{$prefix}4-12 { @extend #{$prefix}one-third; } | |
#{$prefix}5-12 { width:41.666% } | |
#{$prefix}6-12 { @extend #{$prefix}one-half; } | |
#{$prefix}7-12 { width:58.333%; } | |
#{$prefix}8-12 { @extend #{$prefix}two-thirds; } | |
#{$prefix}9-12 { @extend #{$prefix}three-quarters; } | |
#{$prefix}10-12 { @extend #{$prefix}five-sixths; } | |
#{$prefix}11-12 { width:91.666%; } | |
} | |
/** | |
* Our regular, non-responsive width classes. | |
*/ | |
@include device-type; | |
/** | |
* Our responsive classes, if we have enabled them. | |
*/ | |
@if $responsive { | |
@each $name in $breakpoint-has-widths { | |
@include grid-media-query($name) { | |
@include device-type('#{$name}--'); | |
} | |
} | |
} | |
/*------------------------------------*\ | |
$PUSH | |
\*------------------------------------*/ | |
/** | |
* Push classes, to move grid items over to the right by certain amounts. | |
*/ | |
@mixin push-setup($namespace: "") { | |
$prefix: $class-type + "push--" + $namespace; | |
/** | |
* Whole | |
*/ | |
#{$prefix}one-whole { left:100%; @include silent-relative; } | |
/** | |
* Halves | |
*/ | |
#{$prefix}one-half { left:50%; @include silent-relative; } | |
/** | |
* Thirds | |
*/ | |
#{$prefix}one-third { left:33.333%; @include silent-relative; } | |
#{$prefix}two-thirds { left:66.666%; @include silent-relative; } | |
/** | |
* Quarters | |
*/ | |
#{$prefix}one-quarter { left:25%; @include silent-relative; } | |
#{$prefix}two-quarters { @extend #{$prefix}one-half; } | |
#{$prefix}three-quarters { left:75%; @include silent-relative; } | |
/** | |
* Fifths | |
*/ | |
#{$prefix}one-fifth { left:20%; @include silent-relative; } | |
#{$prefix}two-fifths { left:40%; @include silent-relative; } | |
#{$prefix}three-fifths { left:60%; @include silent-relative; } | |
#{$prefix}four-fifths { left:80%; @include silent-relative; } | |
/** | |
* Sixths | |
*/ | |
#{$prefix}one-sixth { left:16.666%; @include silent-relative; } | |
#{$prefix}two-sixths { @extend #{$prefix}one-third; } | |
#{$prefix}three-sixths { @extend #{$prefix}one-half; } | |
#{$prefix}four-sixths { @extend #{$prefix}two-thirds; } | |
#{$prefix}five-sixths { left:83.333%; @include silent-relative; } | |
/** | |
* Eighths | |
*/ | |
#{$prefix}one-eighth { left:12.5%; @include silent-relative; } | |
#{$prefix}two-eighths { @extend #{$prefix}one-quarter; } | |
#{$prefix}three-eighths { left:37.5%; @include silent-relative; } | |
#{$prefix}four-eighths { @extend #{$prefix}one-half; } | |
#{$prefix}five-eighths { left:62.5%; @include silent-relative; } | |
#{$prefix}six-eighths { @extend #{$prefix}three-quarters; } | |
#{$prefix}seven-eighths { left:87.5%; @include silent-relative; } | |
/** | |
* Tenths | |
*/ | |
#{$prefix}one-tenth { left:10%; @include silent-relative; } | |
#{$prefix}two-tenths { @extend #{$prefix}one-fifth; } | |
#{$prefix}three-tenths { left:30%; @include silent-relative; } | |
#{$prefix}four-tenths { @extend #{$prefix}two-fifths; } | |
#{$prefix}five-tenths { @extend #{$prefix}one-half; } | |
#{$prefix}six-tenths { @extend #{$prefix}three-fifths; } | |
#{$prefix}seven-tenths { left:70%; @include silent-relative; } | |
#{$prefix}eight-tenths { @extend #{$prefix}four-fifths; } | |
#{$prefix}nine-tenths { left:90%; @include silent-relative; } | |
/** | |
* Twelfths | |
*/ | |
#{$prefix}one-twelfth { left:8.333%; @include silent-relative; } | |
#{$prefix}two-twelfths { @extend #{$prefix}one-sixth; } | |
#{$prefix}three-twelfths { @extend #{$prefix}one-quarter; } | |
#{$prefix}four-twelfths { @extend #{$prefix}one-third; } | |
#{$prefix}five-twelfths { left:41.666%; @include silent-relative; } | |
#{$prefix}six-twelfths { @extend #{$prefix}one-half; } | |
#{$prefix}seven-twelfths { left:58.333%; @include silent-relative; } | |
#{$prefix}eight-twelfths { @extend #{$prefix}two-thirds; } | |
#{$prefix}nine-twelfths { @extend #{$prefix}three-quarters; } | |
#{$prefix}ten-twelfths { @extend #{$prefix}five-sixths; } | |
#{$prefix}eleven-twelfths { left:91.666%; @include silent-relative; } | |
} | |
@if $push { | |
/** | |
* Not a particularly great selector, but the DRYest way to do things. | |
*/ | |
[class*="push--"] { position:relative; } | |
@include push-setup; | |
@if $responsive { | |
@each $name in $breakpoint-has-push { | |
@include grid-media-query($name) { | |
@include push-setup('#{$name}--'); | |
} | |
} | |
} | |
} | |
/*------------------------------------*\ | |
$PULL | |
\*------------------------------------*/ | |
/** | |
* Pull classes, to move grid items back to the left by certain amounts. | |
*/ | |
@mixin pull-setup($namespace: "") { | |
$prefix: $class-type + "pull--" + $namespace; | |
/** | |
* Whole | |
*/ | |
#{$prefix}row { right:100%; @include silent-relative; } | |
/** | |
* Halves | |
*/ | |
#{$prefix}one-half { right:50%; @include silent-relative; } | |
/** | |
* Thirds | |
*/ | |
#{$prefix}1.3 { right:33.333%; @include silent-relative; } | |
#{$prefix}2.3 { right:66.666%; @include silent-relative; } | |
/** | |
* Quarters | |
*/ | |
#{$prefix}1.4 { right:25%; @include silent-relative; } | |
#{$prefix}2.4 { @extend #{$prefix}one-half; } | |
#{$prefix}3.4 { right:75%; @include silent-relative; } | |
/** | |
* Fifths | |
*/ | |
#{$prefix}1.5 { right:20%; @include silent-relative; } | |
#{$prefix}2.5 { right:40%; @include silent-relative; } | |
#{$prefix}3.5 { right:60%; @include silent-relative; } | |
#{$prefix}4.5 { right:80%; @include silent-relative; } | |
/** | |
* Sixths | |
*/ | |
#{$prefix}1.6 { right:16.666%; @include silent-relative; } | |
#{$prefix}2.6 { @extend #{$prefix}one-third; } | |
#{$prefix}3.6 { @extend #{$prefix}one-half; } | |
#{$prefix}4.6 { @extend #{$prefix}two-thirds; } | |
#{$prefix}6.6 { right:83.333%; @include silent-relative; } | |
/** | |
* Eighths | |
*/ | |
#{$prefix}1.8 { right:12.5%; @include silent-relative; } | |
#{$prefix}2.8 { @extend #{$prefix}one-quarter; } | |
#{$prefix}3.8 { right:37.5%; @include silent-relative; } | |
#{$prefix}4.8 { @extend #{$prefix}one-half; } | |
#{$prefix}5.8 { right:62.5%; @include silent-relative; } | |
#{$prefix}6.8 { @extend #{$prefix}three-quarters; } | |
#{$prefix}7.8 { right:87.5%; @include silent-relative; } | |
/** | |
* Tenths | |
*/ | |
#{$prefix}1.10 { right:10%; @include silent-relative; } | |
#{$prefix}2.10 { @extend #{$prefix}one-fifth; } | |
#{$prefix}3.10 { right:30%; @include silent-relative; } | |
#{$prefix}4.10 { @extend #{$prefix}two-fifths; } | |
#{$prefix}5.10 { @extend #{$prefix}one-half; } | |
#{$prefix}6.10 { @extend #{$prefix}three-fifths; } | |
#{$prefix}7.10 { right:70%; @include silent-relative; } | |
#{$prefix}8.10 { @extend #{$prefix}four-fifths; } | |
#{$prefix}9.10 { right:90%; @include silent-relative; } | |
/** | |
* Twelfths | |
*/ | |
#{$prefix}1.12 { right:8.333%; @include silent-relative; } | |
#{$prefix}2.12 { @extend #{$prefix}one-sixth; } | |
#{$prefix}3.12 { @extend #{$prefix}one-quarter; } | |
#{$prefix}4.12 { @extend #{$prefix}one-third; } | |
#{$prefix}5.12 { right:41.666%; @include silent-relative; } | |
#{$prefix}6.12 { @extend #{$prefix}one-half; } | |
#{$prefix}7.12 { right:58.333%; @include silent-relative; } | |
#{$prefix}8.12 { @extend #{$prefix}two-thirds; } | |
#{$prefix}9.12 { @extend #{$prefix}three-quarters; } | |
#{$prefix}10.12 { @extend #{$prefix}five-sixths; } | |
#{$prefix}11.12 { right:91.666%; @include silent-relative; } | |
} | |
@if $pull { | |
/** | |
* Not a particularly great selector, but the DRYest way to do things. | |
*/ | |
[class*="pull--"] { position:relative; } | |
@include pull-setup; | |
@if $responsive { | |
@each $name in $breakpoint-has-pull { | |
@include grid-media-query($name) { | |
@include pull-setup('#{$name}--'); | |
} | |
} | |
} | |
} |
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
@charset "UTF-8"; | |
/*------------------------------------* $CSSWIZARDRY-GRIDS | |
\*------------------------------------*/ | |
/** | |
* CONTENTS | |
* INTRODUCTION.........How the grid system works. | |
* VARIABLES............Your settings. | |
* MIXINS...............Library mixins. | |
* GRID SETUP...........Build the grid structure. | |
* WIDTHS...............Build our responsive widths around our breakpoints. | |
* PUSH.................Push classes. | |
* PULL.................Pull classes. | |
*/ | |
/*------------------------------------* $INTRODUCTION | |
\*------------------------------------*/ | |
/** | |
* csswizardry grids provides you with widths to suit a number of breakpoints | |
* designed around devices of a size you specify. Out of the box, csswizardry | |
* grids caters to the following types of device: | |
* | |
* palm -- palm-based devices, like phones and small tablets | |
* lap -- lap-based devices, like iPads or laptops | |
* portable -- all of the above | |
* desk -- stationary devices, like desktop computers | |
* regular -- any/all types of device | |
* | |
* These namespaces are then used in the library to give you the ability to | |
* manipulate your layouts based around them, for example: | |
* | |
<div class="grid__item one-whole lap--one-half desk--one-third"> | |
* | |
* This would give you a grid item which is 100% width unless it is on a lap | |
* device, at which point it become 50% wide, or it is on a desktop device, at | |
* which point it becomes 33.333% width. | |
* | |
* csswizardry grids also has push and pull classes which allow you to nudge | |
* grid items left and right by a defined amount. These follow the same naming | |
* convention as above, but are prepended by either `push--` or `pull--`, for | |
* example: | |
* | |
`class="grid__item one-half push--one-half"` | |
* | |
* This would give you a grid item which is 50% width and pushed over to the | |
* right by 50%. | |
* | |
* All classes in csswizardry grids follow this patten, so you should fairly | |
* quickly be able to piece together any combinations you can imagine, for | |
* example: | |
* | |
`class="grid__item one-whole lap--one-half desk--one-third push--desk--one-third"` | |
* | |
`class="grid__item one-quarter palm--one-half push--palm--one-half"` | |
* | |
`class="grid__item palm--one-third desk--five-twelfths"` | |
*/ | |
/*------------------------------------* $VARIABLES | |
\*------------------------------------*/ | |
/** | |
* If you are building a non-responsive site but would still like to use | |
* csswizardry-grids, set this to ‘false’: | |
*/ | |
/** | |
* Is this build mobile first? Setting to ‘true’ means that all grids will be | |
* 100% width if you do not apply a more specific class to them. | |
*/ | |
/** | |
* Set the spacing between your grid items. | |
*/ | |
/** | |
* Would you like Sass’ silent classes, or regular CSS classes? | |
*/ | |
/** | |
* Would you like push and pull classes enabled? | |
*/ | |
/** | |
* Using `inline-block` means that the grid items need their whitespace removing | |
* in order for them to work correctly. Set the following to true if you are | |
* going to achieve this by manually removing/commenting out any whitespace in | |
* your HTML yourself. | |
* | |
* Setting this to false invokes a hack which cannot always be guaranteed, | |
* please see the following for more detail: | |
* | |
* github.com/csswizardry/csswizardry-grids/commit/744d4b23c9d2b77d605b5991e54a397df72e0688 | |
* github.com/csswizardry/inuit.css/issues/170#issuecomment-14859371 | |
*/ | |
/** | |
* Define your breakpoints. The first value is the prefix that shall be used for | |
* your classes (e.g. `.palm--one-half`), the second value is the media query | |
* that the breakpoint fires at. | |
*/ | |
/** | |
* Define which namespaced breakpoints you would like to generate for each of | |
* widths, push and pull. This is handy if you only need pull on, say, desk, or | |
* you only need a new width breakpoint at mobile sizes. It allows you to only | |
* compile as much CSS as you need. All are turned on by default, but you can | |
* add and remove breakpoints at will. | |
* | |
* Push and pull shall only be used if `$push` and/or `$pull` and `$responsive` | |
* have been set to ‘true’. | |
*/ | |
/** | |
* You do not need to edit anything from this line onward; csswizardry-grids is | |
* good to go. Happy griddin’! | |
*/ | |
/*------------------------------------* $MIXINS | |
\*------------------------------------*/ | |
/** | |
* These mixins are for the library to use only, you should not need to modify | |
* them at all. | |
* | |
* Enclose a block of code with a media query as named in `$breakpoints`. | |
*/ | |
/** | |
* Drop relative positioning into silent classes which can’t take advantage of | |
* the `[class*="push--"]` and `[class*="pull--"]` selectors. | |
*/ | |
/*------------------------------------* $GRID SETUP | |
\*------------------------------------*/ | |
/** | |
* 1. Allow the grid system to be used on lists. | |
* 2. Remove any margins and paddings that might affect the grid system. | |
* 3. Apply a negative `margin-left` to negate the columns’ gutters. | |
*/ | |
.grid { | |
list-style: none; | |
/* [1] */ | |
margin: 0; | |
/* [2] */ | |
padding: 0; | |
/* [2] */ | |
margin-left: -24px; | |
/* [3] */ | |
} | |
/** | |
* 1. Cause columns to stack side-by-side. | |
* 2. Space columns apart. | |
* 3. Align columns to the tops of each other. | |
* 4. Full-width unless told to behave otherwise. | |
* 5. Required to combine fluid widths and fixed gutters. | |
*/ | |
.grid__item { | |
display: inline-block; | |
/* [1] */ | |
padding-left: 24px; | |
/* [2] */ | |
vertical-align: top; | |
/* [3] */ | |
width: 100%; | |
/* [4] */ | |
-webkit-box-sizing: border-box; | |
/* [5] */ | |
-moz-box-sizing: border-box; | |
/* [5] */ | |
box-sizing: border-box; | |
/* [5] */ | |
} | |
/** | |
* Reversed grids allow you to structure your source in the opposite order to | |
* how your rendered layout will appear. Extends `.grid`. | |
*/ | |
.grid--rev { | |
direction: rtl; | |
text-align: left; | |
} | |
.grid--rev > .grid__item { | |
direction: ltr; | |
text-align: left; | |
} | |
/** | |
* Gutterless grids have all the properties of regular grids, minus any spacing. | |
* Extends `.grid`. | |
*/ | |
.grid--full { | |
margin-left: 0; | |
} | |
.grid--full > .grid__item { | |
padding-left: 0; | |
} | |
/** | |
* Align the entire grid to the right. Extends `.grid`. | |
*/ | |
.grid--right { | |
text-align: right; | |
} | |
.grid--right > .grid__item { | |
text-align: left; | |
} | |
/** | |
* Centered grids align grid items centrally without needing to use push or pull | |
* classes. Extends `.grid`. | |
*/ | |
.grid--center { | |
text-align: center; | |
} | |
.grid--center > .grid__item { | |
text-align: left; | |
} | |
/** | |
* Align grid cells vertically (`.grid--middle` or `.grid--bottom`). Extends | |
* `.grid`. | |
*/ | |
.grid--middle > .grid__item { | |
vertical-align: middle; | |
} | |
.grid--bottom > .grid__item { | |
vertical-align: bottom; | |
} | |
/** | |
* Create grids with narrower gutters. Extends `.grid`. | |
*/ | |
.grid--narrow { | |
margin-left: -12px; | |
} | |
.grid--narrow > .grid__item { | |
padding-left: 12px; | |
} | |
/** | |
* Create grids with wider gutters. Extends `.grid`. | |
*/ | |
.grid--wide { | |
margin-left: -48px; | |
} | |
.grid--wide > .grid__item { | |
padding-left: 48px; | |
} | |
/*------------------------------------* $WIDTHS | |
\*------------------------------------*/ | |
/** | |
* Create our width classes, prefixed by the specified namespace. | |
*/ | |
/** | |
* Our regular, non-responsive width classes. | |
*/ | |
/** | |
* Whole | |
*/ | |
.row { | |
width: 100%; | |
} | |
/** | |
* Halves | |
*/ | |
.half { | |
width: 50%; | |
} | |
/** | |
* Thirds | |
*/ | |
.1-3 { | |
width: 33.333%; | |
} | |
.2-3 { | |
width: 66.666%; | |
} | |
/** | |
* Quarters | |
*/ | |
.1-4 { | |
width: 25%; | |
} | |
.3-4 { | |
width: 75%; | |
} | |
/** | |
* Fifths | |
*/ | |
.1-5 { | |
width: 20%; | |
} | |
.2-5 { | |
width: 40%; | |
} | |
.3-5 { | |
width: 60%; | |
} | |
.4-5 { | |
width: 80%; | |
} | |
/** | |
* Sixths | |
*/ | |
.1-6 { | |
width: 16.666%; | |
} | |
.5-6 { | |
width: 83.333%; | |
} | |
/** | |
* Eighths | |
*/ | |
.1-8 { | |
width: 12.5%; | |
} | |
.3-8 { | |
width: 37.5%; | |
} | |
.5-8 { | |
width: 62.5%; | |
} | |
.7-8 { | |
width: 87.5%; | |
} | |
/** | |
* Tenths | |
*/ | |
.1-10 { | |
width: 10%; | |
} | |
.3-10 { | |
width: 30%; | |
} | |
.7-10 { | |
width: 70%; | |
} | |
.9-10 { | |
width: 90%; | |
} | |
/** | |
* Twelfths | |
*/ | |
.1-12 { | |
width: 8.333%; | |
} | |
.5-12 { | |
width: 41.666%; | |
} | |
.7-12 { | |
width: 58.333%; | |
} | |
.11-12 { | |
width: 91.666%; | |
} | |
/** | |
* Our responsive classes, if we have enabled them. | |
*/ | |
@media only screen and (max-width: 480px) { | |
/** | |
* Whole | |
*/ | |
.s--row { | |
width: 100%; | |
} | |
/** | |
* Halves | |
*/ | |
.s--half { | |
width: 50%; | |
} | |
/** | |
* Thirds | |
*/ | |
.s--1-3 { | |
width: 33.333%; | |
} | |
.s--2-3 { | |
width: 66.666%; | |
} | |
/** | |
* Quarters | |
*/ | |
.s--1-4 { | |
width: 25%; | |
} | |
.s--3-4 { | |
width: 75%; | |
} | |
/** | |
* Fifths | |
*/ | |
.s--1-5 { | |
width: 20%; | |
} | |
.s--2-5 { | |
width: 40%; | |
} | |
.s--3-5 { | |
width: 60%; | |
} | |
.s--4-5 { | |
width: 80%; | |
} | |
/** | |
* Sixths | |
*/ | |
.s--1-6 { | |
width: 16.666%; | |
} | |
.s--5-6 { | |
width: 83.333%; | |
} | |
/** | |
* Eighths | |
*/ | |
.s--1-8 { | |
width: 12.5%; | |
} | |
.s--3-8 { | |
width: 37.5%; | |
} | |
.s--5-8 { | |
width: 62.5%; | |
} | |
.s--7-8 { | |
width: 87.5%; | |
} | |
/** | |
* Tenths | |
*/ | |
.s--1-10 { | |
width: 10%; | |
} | |
.s--3-10 { | |
width: 30%; | |
} | |
.s--7-10 { | |
width: 70%; | |
} | |
.s--9-10 { | |
width: 90%; | |
} | |
/** | |
* Twelfths | |
*/ | |
.s--1-12 { | |
width: 8.333%; | |
} | |
.s--5-12 { | |
width: 41.666%; | |
} | |
.s--7-12 { | |
width: 58.333%; | |
} | |
.s--11-12 { | |
width: 91.666%; | |
} | |
} | |
@media only screen and (min-width: 481px) and (max-width: 1023px) { | |
/** | |
* Whole | |
*/ | |
.m--row { | |
width: 100%; | |
} | |
/** | |
* Halves | |
*/ | |
.m--half { | |
width: 50%; | |
} | |
/** | |
* Thirds | |
*/ | |
.m--1-3 { | |
width: 33.333%; | |
} | |
.m--2-3 { | |
width: 66.666%; | |
} | |
/** | |
* Quarters | |
*/ | |
.m--1-4 { | |
width: 25%; | |
} | |
.m--3-4 { | |
width: 75%; | |
} | |
/** | |
* Fifths | |
*/ | |
.m--1-5 { | |
width: 20%; | |
} | |
.m--2-5 { | |
width: 40%; | |
} | |
.m--3-5 { | |
width: 60%; | |
} | |
.m--4-5 { | |
width: 80%; | |
} | |
/** | |
* Sixths | |
*/ | |
.m--1-6 { | |
width: 16.666%; | |
} | |
.m--5-6 { | |
width: 83.333%; | |
} | |
/** | |
* Eighths | |
*/ | |
.m--1-8 { | |
width: 12.5%; | |
} | |
.m--3-8 { | |
width: 37.5%; | |
} | |
.m--5-8 { | |
width: 62.5%; | |
} | |
.m--7-8 { | |
width: 87.5%; | |
} | |
/** | |
* Tenths | |
*/ | |
.m--1-10 { | |
width: 10%; | |
} | |
.m--3-10 { | |
width: 30%; | |
} | |
.m--7-10 { | |
width: 70%; | |
} | |
.m--9-10 { | |
width: 90%; | |
} | |
/** | |
* Twelfths | |
*/ | |
.m--1-12 { | |
width: 8.333%; | |
} | |
.m--5-12 { | |
width: 41.666%; | |
} | |
.m--7-12 { | |
width: 58.333%; | |
} | |
.m--11-12 { | |
width: 91.666%; | |
} | |
} | |
@media only screen and (max-width: 1023px) { | |
/** | |
* Whole | |
*/ | |
.l--row { | |
width: 100%; | |
} | |
/** | |
* Halves | |
*/ | |
.l--half { | |
width: 50%; | |
} | |
/** | |
* Thirds | |
*/ | |
.l--1-3 { | |
width: 33.333%; | |
} | |
.l--2-3 { | |
width: 66.666%; | |
} | |
/** | |
* Quarters | |
*/ | |
.l--1-4 { | |
width: 25%; | |
} | |
.l--3-4 { | |
width: 75%; | |
} | |
/** | |
* Fifths | |
*/ | |
.l--1-5 { | |
width: 20%; | |
} | |
.l--2-5 { | |
width: 40%; | |
} | |
.l--3-5 { | |
width: 60%; | |
} | |
.l--4-5 { | |
width: 80%; | |
} | |
/** | |
* Sixths | |
*/ | |
.l--1-6 { | |
width: 16.666%; | |
} | |
.l--5-6 { | |
width: 83.333%; | |
} | |
/** | |
* Eighths | |
*/ | |
.l--1-8 { | |
width: 12.5%; | |
} | |
.l--3-8 { | |
width: 37.5%; | |
} | |
.l--5-8 { | |
width: 62.5%; | |
} | |
.l--7-8 { | |
width: 87.5%; | |
} | |
/** | |
* Tenths | |
*/ | |
.l--1-10 { | |
width: 10%; | |
} | |
.l--3-10 { | |
width: 30%; | |
} | |
.l--7-10 { | |
width: 70%; | |
} | |
.l--9-10 { | |
width: 90%; | |
} | |
/** | |
* Twelfths | |
*/ | |
.l--1-12 { | |
width: 8.333%; | |
} | |
.l--5-12 { | |
width: 41.666%; | |
} | |
.l--7-12 { | |
width: 58.333%; | |
} | |
.l--11-12 { | |
width: 91.666%; | |
} | |
} | |
@media only screen and (min-width: 1024px) { | |
/** | |
* Whole | |
*/ | |
.xl--row { | |
width: 100%; | |
} | |
/** | |
* Halves | |
*/ | |
.xl--half { | |
width: 50%; | |
} | |
/** | |
* Thirds | |
*/ | |
.xl--1-3 { | |
width: 33.333%; | |
} | |
.xl--2-3 { | |
width: 66.666%; | |
} | |
/** | |
* Quarters | |
*/ | |
.xl--1-4 { | |
width: 25%; | |
} | |
.xl--3-4 { | |
width: 75%; | |
} | |
/** | |
* Fifths | |
*/ | |
.xl--1-5 { | |
width: 20%; | |
} | |
.xl--2-5 { | |
width: 40%; | |
} | |
.xl--3-5 { | |
width: 60%; | |
} | |
.xl--4-5 { | |
width: 80%; | |
} | |
/** | |
* Sixths | |
*/ | |
.xl--1-6 { | |
width: 16.666%; | |
} | |
.xl--5-6 { | |
width: 83.333%; | |
} | |
/** | |
* Eighths | |
*/ | |
.xl--1-8 { | |
width: 12.5%; | |
} | |
.xl--3-8 { | |
width: 37.5%; | |
} | |
.xl--5-8 { | |
width: 62.5%; | |
} | |
.xl--7-8 { | |
width: 87.5%; | |
} | |
/** | |
* Tenths | |
*/ | |
.xl--1-10 { | |
width: 10%; | |
} | |
.xl--3-10 { | |
width: 30%; | |
} | |
.xl--7-10 { | |
width: 70%; | |
} | |
.xl--9-10 { | |
width: 90%; | |
} | |
/** | |
* Twelfths | |
*/ | |
.xl--1-12 { | |
width: 8.333%; | |
} | |
.xl--5-12 { | |
width: 41.666%; | |
} | |
.xl--7-12 { | |
width: 58.333%; | |
} | |
.xl--11-12 { | |
width: 91.666%; | |
} | |
} | |
/*------------------------------------* $PUSH | |
\*------------------------------------*/ | |
/** | |
* Push classes, to move grid items over to the right by certain amounts. | |
*/ | |
/*------------------------------------* $PULL | |
\*------------------------------------*/ | |
/** | |
* Pull classes, to move grid items back to the left by certain amounts. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment