Last active
March 22, 2018 19:29
-
-
Save Shelob9/7164336 to your computer and use it in GitHub Desktop.
Stupid simple grid, simplified from http://css-tricks.com/dont-overthink-it-grids/
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
* { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
.grid { | |
background: white; | |
margin: 0 0 20px 0; | |
} | |
.grid:after { | |
/* Or @extend clearfix */ | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
@media screen and (min-width: 480px) { | |
[class*='col-'] { | |
float: left; | |
padding-right: 20px; | |
} | |
.grid [class*='col-']:last-of-type { | |
padding-right: 0; | |
} | |
.col-2-3 { | |
width: 66.66%; | |
} | |
.col-1-3 { | |
width: 33.33%; | |
} | |
.col-1-2 { | |
width: 50%; | |
} | |
.col-1-4 { | |
width: 25%; | |
} | |
.col-1-8 { | |
width: 12.5%; | |
} | |
.module { | |
padding: 20px; | |
background: #eee; | |
} | |
/* Opt-in outside padding */ | |
.grid-pad { | |
padding: 20px 0 20px 20px; | |
} | |
.grid-pad [class*='col-']:last-of-type { | |
padding-right: 20px; | |
} | |
} |
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
*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.grid{background:#fff;margin:0 0 20px}.grid:after{content:"";display:table;clear:both}@media screen and (min-width:480px){[class*=col-]{float:left;padding-right:20px}.grid [class*=col-]:last-of-type{padding-right:0}.col-2-3{width:66.66%}.col-1-3{width:33.33%}.col-1-2{width:50%}.col-1-4{width:25%}.col-1-8{width:12.5%}.module{padding:20px;background:#eee}.grid-pad{padding:20px 0 20px 20px}.grid-pad [class*=col-]:last-of-type{padding-right:20px}} |
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
* { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
.grid { | |
width: 99%; | |
margin-left: auto; | |
margin-right: auto; | |
} | |
.grid:after { | |
/* Or @extend clearfix */ | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
[class*='col-'] { | |
float: left; | |
padding-right: 20px; | |
} | |
.grid [class*='col-']:last-of-type { | |
padding-right: 0; | |
} | |
.col-2third { | |
width: 66.66%; | |
} | |
.col-third { | |
width: 33.33%; | |
} | |
.col-half { | |
width: 50%; | |
} | |
.col-quarter { | |
width: 25%; | |
} | |
.col-eighth { | |
width: 12.5%; | |
} | |
* { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
.grid { | |
width: 99%; | |
margin-left: auto; | |
margin-right: auto; | |
} | |
.grid:after { | |
/* Or @extend clearfix */ | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
[class*='col-'] { | |
float: left; | |
padding-right: 20px; | |
} | |
.grid [class*='col-']:last-of-type { | |
padding-right: 0; | |
} |
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
*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.grid{width:99%;margin-left:auto;margin-right:auto}.grid:after{content:"";display:table;clear:both}[class*='col-']{float:left;padding-right:20px}.grid [class*='col-']:last-of-type{padding-right:0}.col-2third{width:66.66%}.col-third{width:33.33%}.col-half{width:50%}.col-quarter{width:25%}.col-eighth{width:12.5%}*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.grid{width:99%;margin-left:auto;margin-right:auto}.grid:after{content:"";display:table;clear:both}[class*='col-']{float:left;padding-right:20px}.grid [class*='col-']:last-of-type{padding-right:0} |
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
@import "compass"; | |
* { | |
@include box-sizing(border-box); | |
} | |
$pad: 20px; | |
.grid { | |
width: 99%; | |
margin-left: auto; | |
margin-right: auto; | |
&:after { | |
/* Or @extend clearfix */ | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
} | |
[class*='col-'] { | |
float: left; | |
padding-right: $pad; | |
.grid &:last-of-type { | |
padding-right: 0; | |
} | |
} | |
.col-2third { | |
width: 66.66%; | |
} | |
.col-third { | |
width: 33.33%; | |
} | |
.col-half { | |
width: 50%; | |
} | |
.col-quarter { | |
width: 25%; | |
} | |
.col-eighth { | |
width: 12.5%; | |
}* { | |
@include box-sizing(border-box); | |
} | |
.grid { | |
width: 99%; | |
margin-left: auto; | |
margin-right: auto; | |
&:after { | |
/* Or @extend clearfix */ | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
} | |
[class*='col-'] { | |
float: left; | |
padding-right: $pad; | |
.grid &:last-of-type { | |
padding-right: 0; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment