Skip to content

Instantly share code, notes, and snippets.

@BTMPL
Created July 27, 2017 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BTMPL/f151f1a3184712d8db6aa6b41f012d1d to your computer and use it in GitHub Desktop.
Save BTMPL/f151f1a3184712d8db6aa6b41f012d1d to your computer and use it in GitHub Desktop.
@gutter: 8px;
.Row {
display: flex;
max-width: 1170px;
margin: 0 auto;
flex-wrap: wrap;
@media screen and (max-width: 640px) {
flex-direction: column;
}
.Row {
margin: 0 (-1px * @gutter);
}
}
.Column {
flex: 1;
padding: 0 @gutter;
box-sizing: border-box;
}
.generate-columns(12);
.generate-columns(@n, @i: 1) when (@i =< @n) {
.desktop-@{i} {
min-width: (100% / (12/@i));
max-width: (100% / (12/@i));
}
@media screen and (max-width: 640px) {
.mobile-@{i} {
min-width: (100% / (12/@i));
max-width: (100% / (12/@i));
}
}
.generate-columns(@n, (@i + 1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment