Created
May 17, 2016 09:13
-
-
Save norbert-codes/08eea8bb2f4c7f43e4314820a69f43c3 to your computer and use it in GitHub Desktop.
Don't overthink it grids based on css-tricks.com article (https://css-tricks.com/dont-overthink-it-grids/).
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
| * { | |
| @include box-sizing(border-box); | |
| } | |
| $pad: 20px; | |
| .grid { | |
| background: white; | |
| margin: 0 0 $pad 0; | |
| &:after { | |
| /* Or @extend clearfix */ | |
| content: ""; | |
| display: table; | |
| clear: both; | |
| } | |
| } | |
| [class*='col-'] { | |
| float: left; | |
| padding-right: $pad; | |
| .grid &: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%; | |
| } | |
| /* Opt-in outside padding */ | |
| .grid-pad { | |
| padding: $pad 0 $pad $pad; | |
| [class*='col-']:last-of-type { | |
| padding-right: $pad; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment