Skip to content

Instantly share code, notes, and snippets.

@p810
Created December 27, 2016 01:07
Show Gist options
  • Save p810/eb13055ad2559fef572a1454acca6ffe to your computer and use it in GitHub Desktop.
Save p810/eb13055ad2559fef572a1454acca6ffe to your computer and use it in GitHub Desktop.
.row::after {
clear: both;
content: "";
display: block;
}
.columns,
[class*="col-"] {
float: left;
padding: 1rem;
}
.generate-columns(@prefix, @columns, @i: 1) when (@i =< @columns) {
.@{prefix}-@{i} {
width: (@i * 100% / @columns);
}
.generate-columns(@prefix, @columns, (@i + 1));
}
.generate-columns(col, 12);
/* Phone (landscape) columns */
@media only screen and (max-width: 767px) {
.generate-columns(phone, 12);
}
@media only screen and (max-width: 767px) and (orientation: portrait) {
.generate-columns(phone-portrait, 12);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment