Created
February 3, 2015 11:40
-
-
Save haxiomic/d4d0a9ea7135eb851b7c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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
<style> | |
.column,.columns{ | |
background: #DDD; | |
text-align: center; | |
border-radius: 4px; | |
font-size: 1rem; | |
text-transform: uppercase; | |
height: 30px; | |
line-height: 30px; | |
margin-bottom: .75rem; | |
font-weight: 600; | |
letter-spacing: .1rem; | |
} | |
</style> | |
<div class="container"> | |
<h2>Current Offset Method</h2> | |
<p>This result matches the behavior of skeleton CSS exactly (for a column-margin of 4%). The offsets don't seem to line up with the grid nicely or fill the entire width - perhaps this is the intended behavior, but it's not what I expected</p> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
</div> | |
<div class="row"> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
</div> | |
<strong>Offset examples</strong> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="offset-by-one one column">one</div> | |
<div class="one column">one</div> | |
<div class="offset-by-one one column">one</div> | |
<div class="one column">one</div> | |
<div class="offset-by-one three columns">three</div> | |
<div class="one column">one</div> | |
</div> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="offset-by-five one-half column">one-half</div> | |
</div> | |
<div class="row"> | |
<div class="offset-by-one two columns">two</div> | |
<div class="offset-by-one two columns">two</div> | |
<div class="offset-by-one two columns">two</div> | |
<div class="offset-by-one two columns">two</div> | |
</div> | |
<hr> | |
<h2>Altered Method</h2> | |
<p>A minor modification to the calculation of offsets - the columns now all line up and behave as I would expect (for any column-margin)</p> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
</div> | |
<div class="row"> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
</div> | |
<strong>Offset examples</strong> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="offset-by-one-B one column">one</div> | |
<div class="one column">one</div> | |
<div class="offset-by-one-B one column">one</div> | |
<div class="one column">one</div> | |
<div class="offset-by-one-B three columns">three</div> | |
<div class="one column">one</div> | |
</div> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="offset-by-five-B one-half column">one-half</div> | |
</div> | |
<div class="row"> | |
<div class="offset-by-one-B two columns">two</div> | |
<div class="offset-by-one-B two columns">two</div> | |
<div class="offset-by-one-B two columns">two</div> | |
<div class="offset-by-one-B two columns">two</div> | |
</div> | |
</div> |
This file contains 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.11) | |
// Compass (v1.0.3) | |
// ---- | |
/* | |
* Skeleton V2.0.4 | |
* Copyright 2014, Dave Gamache | |
* www.getskeleton.com | |
* Free to use under the MIT license. | |
* http://www.opensource.org/licenses/mit-license.php | |
* 12/9/2014 | |
* Sass Version by Seth Coelen https://github.com/whatsnewsaes | |
*/ | |
// Table of contents | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
//- Grid | |
//- Base Styles | |
//- Typography | |
//- Links | |
//- Buttons | |
//- Forms | |
//- Lists | |
//- Code | |
//- Tables | |
//- Spacing | |
//- Utilities | |
//- Clearing | |
//- Media Queries | |
// Variables | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
// Breakpoints | |
$bp-larger-than-mobile : "min-width: 400px" !default; | |
$bp-larger-than-phablet : "min-width: 550px" !default; | |
$bp-larger-than-tablet : "min-width: 750px" !default; | |
$bp-larger-than-desktop : "min-width: 1000px" !default; | |
$bp-larger-than-desktophd : "min-width: 1200px" !default; | |
// Colors | |
$light-grey: #e1e1e1 !default; | |
$dark-grey: #333 !default; | |
$primary-color: #33c3f0 !default; | |
$secondary-color: lighten($dark-grey, 13.5%) !default; | |
$border-color: #bbb !default; | |
$link-color: #1eaedb !default; | |
$font-color: #222 !default; | |
// Typography | |
$font-family: "Raleway", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif !default; | |
//Grid Variables | |
$container-width: 960px !default; | |
$container-width-larger-than-mobile: 85% !default; | |
$container-width-larger-than-phablet: 80% !default; | |
$total-columns: 12 !default; | |
$column-width: 100 / $total-columns !default; // calculates individual column width based off of # of columns | |
$column-margin: 4% !default; // space between columns | |
// Misc | |
$global-radius: 4px !default; | |
// Functions | |
@function grid-column-width($n) { | |
@return $column-width * $n - ($column-margin*($total-columns - $n)/$total-columns); | |
} | |
@function grid-offset-length($n) { | |
@return grid-column-width($n) + $column-margin; | |
} | |
@function grid-offset-length-altered($n) { | |
@return grid-column-width($n) + $column-margin * 2; | |
} | |
// Grid | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
.container { | |
position: relative; | |
width: 100%; | |
max-width: $container-width; | |
margin: 0 auto; | |
padding: 0 20px; | |
box-sizing: border-box; | |
} | |
.column, | |
.columns { | |
width: 100%; | |
float: left; | |
box-sizing: border-box; | |
} | |
// For devices larger than 400px | |
@media (#{$bp-larger-than-mobile}) { | |
.container { | |
width: $container-width-larger-than-mobile; | |
padding: 0; | |
} | |
} | |
// For devices larger than 550px | |
@media (#{$bp-larger-than-phablet}) { | |
.container { | |
width: $container-width-larger-than-phablet; | |
} | |
.column, | |
.columns { | |
margin-left: $column-margin; | |
} | |
.column:first-child, | |
.columns:first-child { | |
margin-left: 0; | |
} | |
.one.column, | |
.one.columns { width: grid-column-width(1); } | |
.two.columns { width: grid-column-width(2); } | |
.three.columns { width: grid-column-width(3); } | |
.four.columns { width: grid-column-width(4); } | |
.five.columns { width: grid-column-width(5); } | |
.six.columns { width: grid-column-width(6); } | |
.seven.columns { width: grid-column-width(7); } | |
.eight.columns { width: grid-column-width(8); } | |
.nine.columns { width: grid-column-width(9); } | |
.ten.columns { width: grid-column-width(10); } | |
.eleven.columns { width: grid-column-width(11); } | |
.twelve.columns { width: 100%; margin-left: 0; } | |
.one-third.column { width: grid-column-width(4); } | |
.two-thirds.column { width: grid-column-width(8); } | |
.one-half.column { width: grid-column-width(6); } | |
// Offsets | |
.offset-by-one.column, | |
.offset-by-one.columns { margin-left: grid-offset-length(1); } | |
.offset-by-two.column, | |
.offset-by-two.columns { margin-left: grid-offset-length(2); } | |
.offset-by-three.column, | |
.offset-by-three.columns { margin-left: grid-offset-length(3); } | |
.offset-by-four.column, | |
.offset-by-four.columns { margin-left: grid-offset-length(4); } | |
.offset-by-five.column, | |
.offset-by-five.columns { margin-left: grid-offset-length(5); } | |
.offset-by-six.column, | |
.offset-by-six.columns { margin-left: grid-offset-length(6); } | |
.offset-by-seven.column, | |
.offset-by-seven.columns { margin-left: grid-offset-length(7); } | |
.offset-by-eight.column, | |
.offset-by-eight.columns { margin-left: grid-offset-length(8); } | |
.offset-by-nine.column, | |
.offset-by-nine.columns { margin-left: grid-offset-length(9); } | |
.offset-by-ten.column, | |
.offset-by-ten.columns { margin-left: grid-offset-length(10); } | |
.offset-by-eleven.column, | |
.offset-by-eleven.columns { margin-left: grid-offset-length(11); } | |
.offset-by-one-third.column, | |
.offset-by-one-third.columns { margin-left: grid-offset-length(4); } | |
.offset-by-two-thirds.column, | |
.offset-by-two-thirds.columns { margin-left: grid-offset-length(8); } | |
.offset-by-one-half.column, | |
.offset-by-one-half.column { margin-left: grid-offset-length(6); } | |
// Offsets | |
.offset-by-one-B.column, | |
.offset-by-one-B.columns { | |
margin-left: grid-offset-length-altered(1); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(1) - $column-margin; | |
} | |
} | |
.offset-by-two-B.column, | |
.offset-by-two-B.columns { | |
margin-left: grid-offset-length-altered(2); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(2) - $column-margin; | |
} | |
} | |
.offset-by-three-B.column, | |
.offset-by-three-B.columns { | |
margin-left: grid-offset-length-altered(3); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(3) - $column-margin; | |
} | |
} | |
.offset-by-four-B.column, | |
.offset-by-four-B.columns { | |
margin-left: grid-offset-length-altered(4); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(4) - $column-margin; | |
} | |
} | |
.offset-by-five-B.column, | |
.offset-by-five-B.columns { | |
margin-left: grid-offset-length-altered(5); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(5) - $column-margin; | |
} | |
} | |
.offset-by-six-B.column, | |
.offset-by-six-B.columns { | |
margin-left: grid-offset-length-altered(6); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(6) - $column-margin; | |
} | |
} | |
.offset-by-seven-B.column, | |
.offset-by-seven-B.columns { | |
margin-left: grid-offset-length-altered(7); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(7) - $column-margin; | |
} | |
} | |
.offset-by-eight-B.column, | |
.offset-by-eight-B.columns { | |
margin-left: grid-offset-length-altered(8); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(8) - $column-margin; | |
} | |
} | |
.offset-by-nine-B.column, | |
.offset-by-nine-B.columns { | |
margin-left: grid-offset-length-altered(9); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(9) - $column-margin; | |
} | |
} | |
.offset-by-ten-B.column, | |
.offset-by-ten-B.columns { | |
margin-left: grid-offset-length-altered(10); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(10) - $column-margin; | |
} | |
} | |
.offset-by-eleven-B.column, | |
.offset-by-eleven-B.columns { | |
margin-left: grid-offset-length-altered(11); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(11) - $column-margin; | |
} | |
} | |
.offset-by-one-third-B.column, | |
.offset-by-one-third-B.columns { | |
margin-left: grid-offset-length-altered(4); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(4) - $column-margin; | |
} | |
} | |
.offset-by-two-thirds-B.column, | |
.offset-by-two-thirds-B.columns { | |
margin-left: grid-offset-length-altered(8); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(8) - $column-margin; | |
} | |
} | |
.offset-by-one-half-B.column, | |
.offset-by-one-half-B.column { | |
margin-left: grid-offset-length-altered(6); | |
&:first-child{ | |
margin-left: grid-offset-length-altered(6) - $column-margin; | |
} | |
} | |
} | |
// Base Styles | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
// NOTE | |
// html is set to 62.5% so that all the REM measurements throughout Skeleton | |
// are based on 10px sizing. So basically 1.5rem = 15px :) | |
html { | |
font-size: 62.5%; | |
} | |
body { | |
font-size: 1.5em; // currently ems cause chrome bug misinterpreting rems on body element | |
line-height: 1.6; | |
font-weight: 400; | |
font-family: $font-family; | |
color: $font-color; | |
} | |
// Typography | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
h1, h2, h3, h4, h5, h6 { | |
margin-top: 0; | |
margin-bottom: 2rem; | |
font-weight: 300; | |
} | |
h1 { font-size: 4.0rem; line-height: 1.2; letter-spacing: -.1rem; } | |
h2 { font-size: 3.6rem; line-height: 1.25; letter-spacing: -.1rem; } | |
h3 { font-size: 3.0rem; line-height: 1.3; letter-spacing: -.1rem; } | |
h4 { font-size: 2.4rem; line-height: 1.35; letter-spacing: -.08rem; } | |
h5 { font-size: 1.8rem; line-height: 1.5; letter-spacing: -.05rem; } | |
h6 { font-size: 1.5rem; line-height: 1.6; letter-spacing: 0; } | |
// Larger than phablet | |
@media (#{$bp-larger-than-phablet}) { | |
h1 { font-size: 5.0rem; } | |
h2 { font-size: 4.2rem; } | |
h3 { font-size: 3.6rem; } | |
h4 { font-size: 3.0rem; } | |
h5 { font-size: 2.4rem; } | |
h6 { font-size: 1.5rem; } | |
} | |
p { | |
margin-top: 0; | |
} | |
// Links | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
a { | |
color: $link-color; | |
&:hover { | |
color: darken($link-color, 5%); | |
} | |
} | |
// Buttons | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
.button, | |
button { | |
display: inline-block; | |
height: 38px; | |
padding: 0 30px; | |
color: $secondary-color; | |
text-align: center; | |
font-size: 11px; | |
font-weight: 600; | |
line-height: 38px; | |
letter-spacing: .1rem; | |
text-transform: uppercase; | |
text-decoration: none; | |
white-space: nowrap; | |
background-color: transparent; | |
border-radius: $global-radius; | |
border: 1px solid $border-color; | |
cursor: pointer; | |
box-sizing: border-box; | |
} | |
input { | |
&[type="submit"], | |
&[type="reset"], | |
&[type="button"] { | |
display: inline-block; | |
height: 38px; | |
padding: 0 30px; | |
color: $secondary-color; | |
text-align: center; | |
font-size: 11px; | |
font-weight: 600; | |
line-height: 38px; | |
letter-spacing: .1rem; | |
text-transform: uppercase; | |
text-decoration: none; | |
white-space: nowrap; | |
background-color: transparent; | |
border-radius: $global-radius; | |
border: 1px solid $border-color; | |
cursor: pointer; | |
box-sizing: border-box; | |
} | |
} | |
.button:hover, | |
button:hover { | |
color: $dark-grey; | |
border-color: lighten($dark-grey, 33.3%); | |
outline: 0; | |
} | |
input { | |
&[type="submit"]:hover, | |
&[type="reset"]:hover, | |
&[type="button"]:hover { | |
color: $dark-grey; | |
border-color: lighten($dark-grey, 33.3%); | |
outline: 0; | |
} | |
} | |
.button:focus, | |
button:focus { | |
color: $dark-grey; | |
border-color: lighten($dark-grey, 33.3%); | |
outline: 0; | |
} | |
input { | |
&[type="submit"]:focus, | |
&[type="reset"]:focus, | |
&[type="button"]:focus { | |
color: $dark-grey; | |
border-color: lighten($dark-grey, 33.3%); | |
outline: 0; | |
} | |
} | |
.button.button-primary, | |
button.button-primary { | |
color: #fff; | |
background-color: $primary-color; | |
border-color: $primary-color; | |
} | |
input { | |
&[type="submit"].button-primary, | |
&[type="reset"].button-primary, | |
&[type="button"].button-primary { | |
color: #fff; | |
background-color: $primary-color; | |
border-color: $primary-color; | |
} | |
} | |
.button.button-primary:hover, | |
button.button-primary:hover { | |
color: #fff; | |
background-color: $link-color; | |
border-color: $link-color; | |
} | |
input { | |
&[type="submit"].button-primary:hover, | |
&[type="reset"].button-primary:hover, | |
&[type="button"].button-primary:hover { | |
color: #fff; | |
background-color: $link-color; | |
border-color: $link-color; | |
} | |
} | |
.button.button-primary:focus, | |
button.button-primary:focus { | |
color: #fff; | |
background-color: $link-color; | |
border-color: $link-color; | |
} | |
input { | |
&[type="submit"].button-primary:focus, | |
&[type="reset"].button-primary:focus, | |
&[type="button"].button-primary:focus { | |
color: #fff; | |
background-color: $link-color; | |
border-color: $link-color; | |
} | |
&[type="email"], | |
&[type="number"], | |
&[type="search"], | |
&[type="text"], | |
&[type="tel"], | |
&[type="url"], | |
&[type="password"] { | |
height: 38px; | |
padding: 6px 10px; // The 6px vertically centers text on FF, ignored by Webkit | |
background-color: #fff; | |
border: 1px solid lighten($border-color, 8.8%); | |
border-radius: $global-radius; | |
box-shadow: none; | |
box-sizing: border-box; | |
} | |
} | |
// Forms | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
textarea, | |
select { | |
height: 38px; | |
padding: 6px 10px; // The 6px vertically centers text on FF, ignored by Webkit | |
background-color: #fff; | |
border: 1px solid lighten($border-color, 8.8%); | |
border-radius: $global-radius; | |
box-shadow: none; | |
box-sizing: border-box; | |
} | |
// Removes awkward default styles on some inputs for iOS | |
input { | |
&[type="email"], | |
&[type="number"], | |
&[type="search"], | |
&[type="text"], | |
&[type="tel"], | |
&[type="url"], | |
&[type="password"] { | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
} | |
} | |
textarea { | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
min-height: 65px; | |
padding-top: 6px; | |
padding-bottom: 6px; | |
} | |
input { | |
&[type="email"]:focus, | |
&[type="number"]:focus, | |
&[type="search"]:focus, | |
&[type="text"]:focus, | |
&[type="tel"]:focus, | |
&[type="url"]:focus, | |
&[type="password"]:focus { | |
border: 1px solid $primary-color; | |
outline: 0; | |
} | |
} | |
textarea:focus, | |
select:focus { | |
border: 1px solid $primary-color; | |
outline: 0; | |
} | |
label, | |
legend { | |
display: block; | |
margin-bottom: .5rem; | |
font-weight: 600; | |
} | |
fieldset { | |
padding: 0; | |
border-width: 0; | |
} | |
input { | |
&[type="checkbox"], | |
&[type="radio"] { | |
display: inline; | |
} | |
} | |
label > .label-body { | |
display: inline-block; | |
margin-left: .5rem; | |
font-weight: normal; | |
} | |
// Lists | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
ul { | |
list-style: circle inside; | |
} | |
ol { | |
list-style: decimal inside; | |
padding-left: 0; | |
margin-top: 0; | |
} | |
ul { | |
padding-left: 0; | |
margin-top: 0; | |
ul, ol { | |
margin: 1.5rem 0 1.5rem 3rem; | |
font-size: 90%; | |
} | |
} | |
ol { | |
ol, ul { | |
margin: 1.5rem 0 1.5rem 3rem; | |
font-size: 90%; | |
} | |
} | |
li { | |
margin-bottom: 1rem; | |
} | |
// Code | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
code { | |
padding: .2rem .5rem; | |
margin: 0 .2rem; | |
font-size: 90%; | |
white-space: nowrap; | |
background: lighten($light-grey, 6.4%); | |
border: 1px solid $light-grey; | |
border-radius: $global-radius; | |
} | |
pre > code { | |
display: block; | |
padding: 1rem 1.5rem; | |
white-space: pre; | |
} | |
// Tables | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
th, | |
td { | |
padding: 12px 15px; | |
text-align: left; | |
border-bottom: 1px solid $light-grey; | |
} | |
th:first-child, | |
td:first-child { | |
padding-left: 0; | |
} | |
th:last-child, | |
td:last-child { | |
padding-right: 0; | |
} | |
// Spacing | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
button, | |
.button { | |
margin-bottom: 1rem; | |
} | |
input, | |
textarea, | |
select, | |
fieldset { | |
margin-bottom: 1.5rem; | |
} | |
pre, | |
blockquote, | |
dl, | |
figure, | |
table, | |
p, | |
ul, | |
ol, | |
form { | |
margin-bottom: 2.5rem; | |
} | |
// Utilities | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
.u-full-width { | |
width: 100%; | |
box-sizing: border-box; | |
} | |
.u-max-full-width { | |
max-width: 100%; | |
box-sizing: border-box; | |
} | |
.u-pull-right { | |
float: right; | |
} | |
.u-pull-left { | |
float: left; | |
} | |
// Misc | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
hr { | |
margin-top: 3rem; | |
margin-bottom: 3.5rem; | |
border-width: 0; | |
border-top: 1px solid $light-grey; | |
} | |
// Clearing | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
// Self Clearing Goodness | |
.container:after, | |
.row:after, | |
.u-cf { | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
// Media Queries | |
//–––––––––––––––––––––––––––––––––––––––––––––––––– | |
// Note: The best way to structure the use of media queries is to create the queries | |
// near the relevant code. For example, if you wanted to change the styles for buttons | |
// on small devices, paste the mobile query code up in the buttons section and style it | |
// there. | |
// Larger than mobile | |
@media (#{$bp-larger-than-mobile}) {} | |
// Larger than phablet (also point when grid becomes active) | |
@media (#{$bp-larger-than-phablet}) {} | |
// Larger than tablet | |
@media (#{$bp-larger-than-tablet}) {} | |
// Larger than desktop | |
@media (#{$bp-larger-than-desktop}) {} | |
// Larger than Desktop HD | |
@media (#{$bp-larger-than-desktophd}) {} |
This file contains 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
/* | |
* Skeleton V2.0.4 | |
* Copyright 2014, Dave Gamache | |
* www.getskeleton.com | |
* Free to use under the MIT license. | |
* http://www.opensource.org/licenses/mit-license.php | |
* 12/9/2014 | |
* Sass Version by Seth Coelen https://github.com/whatsnewsaes | |
*/ | |
.container { | |
position: relative; | |
width: 100%; | |
max-width: 960px; | |
margin: 0 auto; | |
padding: 0 20px; | |
box-sizing: border-box; | |
} | |
.column, | |
.columns { | |
width: 100%; | |
float: left; | |
box-sizing: border-box; | |
} | |
@media (min-width: 400px) { | |
.container { | |
width: 85%; | |
padding: 0; | |
} | |
} | |
@media (min-width: 550px) { | |
.container { | |
width: 80%; | |
} | |
.column, | |
.columns { | |
margin-left: 4%; | |
} | |
.column:first-child, | |
.columns:first-child { | |
margin-left: 0; | |
} | |
.one.column, | |
.one.columns { | |
width: 4.66667%; | |
} | |
.two.columns { | |
width: 13.33333%; | |
} | |
.three.columns { | |
width: 22%; | |
} | |
.four.columns { | |
width: 30.66667%; | |
} | |
.five.columns { | |
width: 39.33333%; | |
} | |
.six.columns { | |
width: 48%; | |
} | |
.seven.columns { | |
width: 56.66667%; | |
} | |
.eight.columns { | |
width: 65.33333%; | |
} | |
.nine.columns { | |
width: 74%; | |
} | |
.ten.columns { | |
width: 82.66667%; | |
} | |
.eleven.columns { | |
width: 91.33333%; | |
} | |
.twelve.columns { | |
width: 100%; | |
margin-left: 0; | |
} | |
.one-third.column { | |
width: 30.66667%; | |
} | |
.two-thirds.column { | |
width: 65.33333%; | |
} | |
.one-half.column { | |
width: 48%; | |
} | |
.offset-by-one.column, | |
.offset-by-one.columns { | |
margin-left: 8.66667%; | |
} | |
.offset-by-two.column, | |
.offset-by-two.columns { | |
margin-left: 17.33333%; | |
} | |
.offset-by-three.column, | |
.offset-by-three.columns { | |
margin-left: 26%; | |
} | |
.offset-by-four.column, | |
.offset-by-four.columns { | |
margin-left: 34.66667%; | |
} | |
.offset-by-five.column, | |
.offset-by-five.columns { | |
margin-left: 43.33333%; | |
} | |
.offset-by-six.column, | |
.offset-by-six.columns { | |
margin-left: 52%; | |
} | |
.offset-by-seven.column, | |
.offset-by-seven.columns { | |
margin-left: 60.66667%; | |
} | |
.offset-by-eight.column, | |
.offset-by-eight.columns { | |
margin-left: 69.33333%; | |
} | |
.offset-by-nine.column, | |
.offset-by-nine.columns { | |
margin-left: 78%; | |
} | |
.offset-by-ten.column, | |
.offset-by-ten.columns { | |
margin-left: 86.66667%; | |
} | |
.offset-by-eleven.column, | |
.offset-by-eleven.columns { | |
margin-left: 95.33333%; | |
} | |
.offset-by-one-third.column, | |
.offset-by-one-third.columns { | |
margin-left: 34.66667%; | |
} | |
.offset-by-two-thirds.column, | |
.offset-by-two-thirds.columns { | |
margin-left: 69.33333%; | |
} | |
.offset-by-one-half.column, | |
.offset-by-one-half.column { | |
margin-left: 52%; | |
} | |
.offset-by-one-B.column, | |
.offset-by-one-B.columns { | |
margin-left: 12.66667%; | |
} | |
.offset-by-one-B.column:first-child, | |
.offset-by-one-B.columns:first-child { | |
margin-left: 8.66667%; | |
} | |
.offset-by-two-B.column, | |
.offset-by-two-B.columns { | |
margin-left: 21.33333%; | |
} | |
.offset-by-two-B.column:first-child, | |
.offset-by-two-B.columns:first-child { | |
margin-left: 17.33333%; | |
} | |
.offset-by-three-B.column, | |
.offset-by-three-B.columns { | |
margin-left: 30%; | |
} | |
.offset-by-three-B.column:first-child, | |
.offset-by-three-B.columns:first-child { | |
margin-left: 26%; | |
} | |
.offset-by-four-B.column, | |
.offset-by-four-B.columns { | |
margin-left: 38.66667%; | |
} | |
.offset-by-four-B.column:first-child, | |
.offset-by-four-B.columns:first-child { | |
margin-left: 34.66667%; | |
} | |
.offset-by-five-B.column, | |
.offset-by-five-B.columns { | |
margin-left: 47.33333%; | |
} | |
.offset-by-five-B.column:first-child, | |
.offset-by-five-B.columns:first-child { | |
margin-left: 43.33333%; | |
} | |
.offset-by-six-B.column, | |
.offset-by-six-B.columns { | |
margin-left: 56%; | |
} | |
.offset-by-six-B.column:first-child, | |
.offset-by-six-B.columns:first-child { | |
margin-left: 52%; | |
} | |
.offset-by-seven-B.column, | |
.offset-by-seven-B.columns { | |
margin-left: 64.66667%; | |
} | |
.offset-by-seven-B.column:first-child, | |
.offset-by-seven-B.columns:first-child { | |
margin-left: 60.66667%; | |
} | |
.offset-by-eight-B.column, | |
.offset-by-eight-B.columns { | |
margin-left: 73.33333%; | |
} | |
.offset-by-eight-B.column:first-child, | |
.offset-by-eight-B.columns:first-child { | |
margin-left: 69.33333%; | |
} | |
.offset-by-nine-B.column, | |
.offset-by-nine-B.columns { | |
margin-left: 82%; | |
} | |
.offset-by-nine-B.column:first-child, | |
.offset-by-nine-B.columns:first-child { | |
margin-left: 78%; | |
} | |
.offset-by-ten-B.column, | |
.offset-by-ten-B.columns { | |
margin-left: 90.66667%; | |
} | |
.offset-by-ten-B.column:first-child, | |
.offset-by-ten-B.columns:first-child { | |
margin-left: 86.66667%; | |
} | |
.offset-by-eleven-B.column, | |
.offset-by-eleven-B.columns { | |
margin-left: 99.33333%; | |
} | |
.offset-by-eleven-B.column:first-child, | |
.offset-by-eleven-B.columns:first-child { | |
margin-left: 95.33333%; | |
} | |
.offset-by-one-third-B.column, | |
.offset-by-one-third-B.columns { | |
margin-left: 38.66667%; | |
} | |
.offset-by-one-third-B.column:first-child, | |
.offset-by-one-third-B.columns:first-child { | |
margin-left: 34.66667%; | |
} | |
.offset-by-two-thirds-B.column, | |
.offset-by-two-thirds-B.columns { | |
margin-left: 73.33333%; | |
} | |
.offset-by-two-thirds-B.column:first-child, | |
.offset-by-two-thirds-B.columns:first-child { | |
margin-left: 69.33333%; | |
} | |
.offset-by-one-half-B.column, | |
.offset-by-one-half-B.column { | |
margin-left: 56%; | |
} | |
.offset-by-one-half-B.column:first-child, | |
.offset-by-one-half-B.column:first-child { | |
margin-left: 52%; | |
} | |
} | |
html { | |
font-size: 62.5%; | |
} | |
body { | |
font-size: 1.5em; | |
line-height: 1.6; | |
font-weight: 400; | |
font-family: "Raleway", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; | |
color: #222; | |
} | |
h1, h2, h3, h4, h5, h6 { | |
margin-top: 0; | |
margin-bottom: 2rem; | |
font-weight: 300; | |
} | |
h1 { | |
font-size: 4.0rem; | |
line-height: 1.2; | |
letter-spacing: -.1rem; | |
} | |
h2 { | |
font-size: 3.6rem; | |
line-height: 1.25; | |
letter-spacing: -.1rem; | |
} | |
h3 { | |
font-size: 3.0rem; | |
line-height: 1.3; | |
letter-spacing: -.1rem; | |
} | |
h4 { | |
font-size: 2.4rem; | |
line-height: 1.35; | |
letter-spacing: -.08rem; | |
} | |
h5 { | |
font-size: 1.8rem; | |
line-height: 1.5; | |
letter-spacing: -.05rem; | |
} | |
h6 { | |
font-size: 1.5rem; | |
line-height: 1.6; | |
letter-spacing: 0; | |
} | |
@media (min-width: 550px) { | |
h1 { | |
font-size: 5.0rem; | |
} | |
h2 { | |
font-size: 4.2rem; | |
} | |
h3 { | |
font-size: 3.6rem; | |
} | |
h4 { | |
font-size: 3.0rem; | |
} | |
h5 { | |
font-size: 2.4rem; | |
} | |
h6 { | |
font-size: 1.5rem; | |
} | |
} | |
p { | |
margin-top: 0; | |
} | |
a { | |
color: #1eaedb; | |
} | |
a:hover { | |
color: #1b9cc5; | |
} | |
.button, | |
button { | |
display: inline-block; | |
height: 38px; | |
padding: 0 30px; | |
color: #555555; | |
text-align: center; | |
font-size: 11px; | |
font-weight: 600; | |
line-height: 38px; | |
letter-spacing: .1rem; | |
text-transform: uppercase; | |
text-decoration: none; | |
white-space: nowrap; | |
background-color: transparent; | |
border-radius: 4px; | |
border: 1px solid #bbb; | |
cursor: pointer; | |
box-sizing: border-box; | |
} | |
input[type="submit"], input[type="reset"], input[type="button"] { | |
display: inline-block; | |
height: 38px; | |
padding: 0 30px; | |
color: #555555; | |
text-align: center; | |
font-size: 11px; | |
font-weight: 600; | |
line-height: 38px; | |
letter-spacing: .1rem; | |
text-transform: uppercase; | |
text-decoration: none; | |
white-space: nowrap; | |
background-color: transparent; | |
border-radius: 4px; | |
border: 1px solid #bbb; | |
cursor: pointer; | |
box-sizing: border-box; | |
} | |
.button:hover, | |
button:hover { | |
color: #333; | |
border-color: #888888; | |
outline: 0; | |
} | |
input[type="submit"]:hover, input[type="reset"]:hover, input[type="button"]:hover { | |
color: #333; | |
border-color: #888888; | |
outline: 0; | |
} | |
.button:focus, | |
button:focus { | |
color: #333; | |
border-color: #888888; | |
outline: 0; | |
} | |
input[type="submit"]:focus, input[type="reset"]:focus, input[type="button"]:focus { | |
color: #333; | |
border-color: #888888; | |
outline: 0; | |
} | |
.button.button-primary, | |
button.button-primary { | |
color: #fff; | |
background-color: #33c3f0; | |
border-color: #33c3f0; | |
} | |
input[type="submit"].button-primary, input[type="reset"].button-primary, input[type="button"].button-primary { | |
color: #fff; | |
background-color: #33c3f0; | |
border-color: #33c3f0; | |
} | |
.button.button-primary:hover, | |
button.button-primary:hover { | |
color: #fff; | |
background-color: #1eaedb; | |
border-color: #1eaedb; | |
} | |
input[type="submit"].button-primary:hover, input[type="reset"].button-primary:hover, input[type="button"].button-primary:hover { | |
color: #fff; | |
background-color: #1eaedb; | |
border-color: #1eaedb; | |
} | |
.button.button-primary:focus, | |
button.button-primary:focus { | |
color: #fff; | |
background-color: #1eaedb; | |
border-color: #1eaedb; | |
} | |
input[type="submit"].button-primary:focus, input[type="reset"].button-primary:focus, input[type="button"].button-primary:focus { | |
color: #fff; | |
background-color: #1eaedb; | |
border-color: #1eaedb; | |
} | |
input[type="email"], input[type="number"], input[type="search"], input[type="text"], input[type="tel"], input[type="url"], input[type="password"] { | |
height: 38px; | |
padding: 6px 10px; | |
background-color: #fff; | |
border: 1px solid #d1d1d1; | |
border-radius: 4px; | |
box-shadow: none; | |
box-sizing: border-box; | |
} | |
textarea, | |
select { | |
height: 38px; | |
padding: 6px 10px; | |
background-color: #fff; | |
border: 1px solid #d1d1d1; | |
border-radius: 4px; | |
box-shadow: none; | |
box-sizing: border-box; | |
} | |
input[type="email"], input[type="number"], input[type="search"], input[type="text"], input[type="tel"], input[type="url"], input[type="password"] { | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
} | |
textarea { | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
min-height: 65px; | |
padding-top: 6px; | |
padding-bottom: 6px; | |
} | |
input[type="email"]:focus, input[type="number"]:focus, input[type="search"]:focus, input[type="text"]:focus, input[type="tel"]:focus, input[type="url"]:focus, input[type="password"]:focus { | |
border: 1px solid #33c3f0; | |
outline: 0; | |
} | |
textarea:focus, | |
select:focus { | |
border: 1px solid #33c3f0; | |
outline: 0; | |
} | |
label, | |
legend { | |
display: block; | |
margin-bottom: .5rem; | |
font-weight: 600; | |
} | |
fieldset { | |
padding: 0; | |
border-width: 0; | |
} | |
input[type="checkbox"], input[type="radio"] { | |
display: inline; | |
} | |
label > .label-body { | |
display: inline-block; | |
margin-left: .5rem; | |
font-weight: normal; | |
} | |
ul { | |
list-style: circle inside; | |
} | |
ol { | |
list-style: decimal inside; | |
padding-left: 0; | |
margin-top: 0; | |
} | |
ul { | |
padding-left: 0; | |
margin-top: 0; | |
} | |
ul ul, ul ol { | |
margin: 1.5rem 0 1.5rem 3rem; | |
font-size: 90%; | |
} | |
ol ol, ol ul { | |
margin: 1.5rem 0 1.5rem 3rem; | |
font-size: 90%; | |
} | |
li { | |
margin-bottom: 1rem; | |
} | |
code { | |
padding: .2rem .5rem; | |
margin: 0 .2rem; | |
font-size: 90%; | |
white-space: nowrap; | |
background: #f1f1f1; | |
border: 1px solid #e1e1e1; | |
border-radius: 4px; | |
} | |
pre > code { | |
display: block; | |
padding: 1rem 1.5rem; | |
white-space: pre; | |
} | |
th, | |
td { | |
padding: 12px 15px; | |
text-align: left; | |
border-bottom: 1px solid #e1e1e1; | |
} | |
th:first-child, | |
td:first-child { | |
padding-left: 0; | |
} | |
th:last-child, | |
td:last-child { | |
padding-right: 0; | |
} | |
button, | |
.button { | |
margin-bottom: 1rem; | |
} | |
input, | |
textarea, | |
select, | |
fieldset { | |
margin-bottom: 1.5rem; | |
} | |
pre, | |
blockquote, | |
dl, | |
figure, | |
table, | |
p, | |
ul, | |
ol, | |
form { | |
margin-bottom: 2.5rem; | |
} | |
.u-full-width { | |
width: 100%; | |
box-sizing: border-box; | |
} | |
.u-max-full-width { | |
max-width: 100%; | |
box-sizing: border-box; | |
} | |
.u-pull-right { | |
float: right; | |
} | |
.u-pull-left { | |
float: left; | |
} | |
hr { | |
margin-top: 3rem; | |
margin-bottom: 3.5rem; | |
border-width: 0; | |
border-top: 1px solid #e1e1e1; | |
} | |
.container:after, | |
.row:after, | |
.u-cf { | |
content: ""; | |
display: table; | |
clear: both; | |
} |
This file contains 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
<style> | |
.column,.columns{ | |
background: #DDD; | |
text-align: center; | |
border-radius: 4px; | |
font-size: 1rem; | |
text-transform: uppercase; | |
height: 30px; | |
line-height: 30px; | |
margin-bottom: .75rem; | |
font-weight: 600; | |
letter-spacing: .1rem; | |
} | |
</style> | |
<div class="container"> | |
<h2>Current Offset Method</h2> | |
<p>This result matches the behavior of skeleton CSS exactly (for a column-margin of 4%). The offsets don't seem to line up with the grid nicely or fill the entire width - perhaps this is the intended behavior, but it's not what I expected</p> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
</div> | |
<div class="row"> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
</div> | |
<strong>Offset examples</strong> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="offset-by-one one column">one</div> | |
<div class="one column">one</div> | |
<div class="offset-by-one one column">one</div> | |
<div class="one column">one</div> | |
<div class="offset-by-one three columns">three</div> | |
<div class="one column">one</div> | |
</div> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="offset-by-five one-half column">one-half</div> | |
</div> | |
<div class="row"> | |
<div class="offset-by-one two columns">two</div> | |
<div class="offset-by-one two columns">two</div> | |
<div class="offset-by-one two columns">two</div> | |
<div class="offset-by-one two columns">two</div> | |
</div> | |
<hr> | |
<h2>Altered Method</h2> | |
<p>A minor modification to the calculation of offsets - the columns now all line up and behave as I would expect (for any column-margin)</p> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
<div class="one column">one</div> | |
</div> | |
<div class="row"> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
<div class="two columns">two</div> | |
</div> | |
<strong>Offset examples</strong> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="offset-by-one-B one column">one</div> | |
<div class="one column">one</div> | |
<div class="offset-by-one-B one column">one</div> | |
<div class="one column">one</div> | |
<div class="offset-by-one-B three columns">three</div> | |
<div class="one column">one</div> | |
</div> | |
<div class="row"> | |
<div class="one column">one</div> | |
<div class="offset-by-five-B one-half column">one-half</div> | |
</div> | |
<div class="row"> | |
<div class="offset-by-one-B two columns">two</div> | |
<div class="offset-by-one-B two columns">two</div> | |
<div class="offset-by-one-B two columns">two</div> | |
<div class="offset-by-one-B two columns">two</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment