Last active
December 6, 2018 14:35
-
-
Save Sergioamjr/3503fc2fcd6c799270ffb7bd211531f5 to your computer and use it in GitHub Desktop.
Sistema de Grid com Stylus
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
.container { | |
margin 0 auto | |
padding 0 15px | |
max-width 1200px | |
} | |
.grid { | |
display flex | |
flex-wrap wrap | |
margin 0 -15px | |
& > div { | |
width 100% | |
box-sizing border-box | |
padding 0 15px | |
} | |
} | |
generateColumn(prefix, x) { | |
for n in (1..x) { | |
.{prefix}-{n}-{x} { | |
width ((0% + n / x * 100)); | |
} | |
} | |
} | |
.grid { | |
generateColumn('xs', 12) | |
} | |
@media screen and (min-width: 768px) { | |
.grid { | |
generateColumn('sm', 12) | |
} | |
} | |
@media screen and (min-width: 992px) { | |
.grid { | |
generateColumn('md', 12) | |
} | |
} | |
@media screen and (min-width: 1200px) { | |
.grid { | |
generateColumn('lg', 12) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment