-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from buzzfeed/SOLID-208-improve-block-grid
change block grid to use calc
- Loading branch information
Showing
2 changed files
with
98 additions
and
118 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
.block-grid { | ||
font-size: 0; | ||
margin: 0 -.5rem; | ||
margin: -.5rem; | ||
padding: 0; | ||
} | ||
|
||
.block-grid-item { | ||
display: inline-block; | ||
font-size: 1rem; | ||
padding: .5rem; | ||
vertical-align: top; | ||
margin: .5rem; | ||
} | ||
|
||
@function calc-margin($block-grid-width) { | ||
@return calc(#{$block-grid-width} - 1rem); | ||
} | ||
|
||
@include generate-breakpoint-prefixes { | ||
&block-grid-1 .block-grid-item { width: 100%; } | ||
&block-grid-2 .block-grid-item { width: percentage(1/2); } | ||
&block-grid-3 .block-grid-item { width: percentage(1/3); } | ||
&block-grid-4 .block-grid-item { width: percentage(1/4); } | ||
&block-grid-5 .block-grid-item { width: percentage(1/5); } | ||
&block-grid-6 .block-grid-item { width: percentage(1/6); } | ||
&block-grid-2 .block-grid-item { width: calc-margin(percentage(1/2)); } | ||
&block-grid-3 .block-grid-item { width: calc-margin(percentage(1/3)); } | ||
&block-grid-4 .block-grid-item { width: calc-margin(percentage(1/4)); } | ||
&block-grid-5 .block-grid-item { width: calc-margin(percentage(1/5)); } | ||
&block-grid-6 .block-grid-item { width: calc-margin(percentage(1/6)); } | ||
} |