Last active
January 17, 2017 14:24
-
-
Save jonathanpath/63fa1fb5e6be608e08da to your computer and use it in GitHub Desktop.
Constrained layout SMACSS style
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
/*=================================== | |
= Constrained = | |
===================================*/ | |
$constrained-width: 1170; | |
/* =With padding | |
---------------------- */ | |
.constrained { | |
max-width: #{$constrained-width}px; | |
margin-left: auto; | |
margin-right: auto; | |
padding-left: 15px; | |
padding-right: 15px; | |
} | |
@for $i from 1 through 24 { | |
.constrained-#{$i} { | |
@extend .constrained; | |
max-width: #{$constrained-width/24*$i}px; | |
} | |
} | |
/* =No padding | |
---------------------- */ | |
.constrained-nopadding { | |
max-width: #{$constrained-width}px; | |
margin-left: auto; | |
margin-right: auto; | |
} | |
@for $i from 1 through 24 { | |
.constrained-nopadding-#{$i} { | |
@extend .constrained-nopadding; | |
max-width: #{$constrained-width/24*$i}px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment