Last active
December 11, 2015 12:28
-
-
Save mattics/4600397 to your computer and use it in GitHub Desktop.
A stripped down version of 4563625 which is non specific to bootstrap and easier to understand the concept due to lack of clutter.
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
@media (min-width: 1200px) { | |
.makeMyStyles(940px, 15px) | |
} | |
@media (max-width: 1199px) { | |
.makeMyStyles(768px, 12px) | |
} | |
.makeMyStyles(@width, @padding) { | |
.makeHalfWidthColumn() { // just an example mixin | |
width: @width / 2l | |
float: left; | |
} | |
.myContainer{width: @width; margin: 0 auto; } | |
.myInnerContent{ padding:@padding; width: @width - (@padding * 2); } | |
.myColumn { .makeHalfWidthColumn() } | |
} | |
//------------ CSS OUTPUT ------------// | |
@media (min-width: 1200px) { | |
.myContainer { | |
width: 940px; | |
margin: 0 auto; | |
} | |
.myInnerContent { | |
padding: 15px; | |
width: 910px; | |
} | |
.myColumn { | |
width: 470px; | |
float: left; | |
} | |
} | |
@media (max-width: 1199px) { | |
.myContainer { | |
width: 768px; | |
margin: 0 auto; | |
} | |
.myInnerContent { | |
padding: 12px; | |
width: 744px; | |
} | |
.myColumn { | |
width: 384px; | |
float: left; | |
} | |
} | |
//------------ CSS OUTPUT ------------// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment