Skip to content

Commit

Permalink
Merge pull request #582 from primer/offset-is-important-v2
Browse files Browse the repository at this point in the history
Add responsive variants & `!important` to grid offset classes
  • Loading branch information
shawnbot authored Oct 17, 2018
2 parents 957fa8b + 4c975aa commit 11fe822
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions modules/primer-layout/lib/grid-offset.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
// Optional offset options to work with grid.scss

// Offset Columns
.offset-1 { margin-left: (1 / 12 * 100%); }
.offset-2 { margin-left: (2 / 12 * 100%); }
.offset-3 { margin-left: (3 / 12 * 100%); }
.offset-4 { margin-left: (4 / 12 * 100%); }
.offset-5 { margin-left: (5 / 12 * 100%); }
.offset-6 { margin-left: (6 / 12 * 100%); }
.offset-7 { margin-left: (7 / 12 * 100%); }
.offset-8 { margin-left: (8 / 12 * 100%); }
.offset-9 { margin-left: (9 / 12 * 100%); }
.offset-10 { margin-left: (10 / 12 * 100%); }
.offset-11 { margin-left: (11 / 12 * 100%); }

@each $breakpoint in map-keys($breakpoints) {
@each $breakpoint, $variant in $responsive-variants {
@include breakpoint($breakpoint) {
.offset-#{$breakpoint}-1 { margin-left: (1 / 12 * 100%); }
.offset-#{$breakpoint}-2 { margin-left: (2 / 12 * 100%); }
.offset-#{$breakpoint}-3 { margin-left: (3 / 12 * 100%); }
.offset-#{$breakpoint}-4 { margin-left: (4 / 12 * 100%); }
.offset-#{$breakpoint}-5 { margin-left: (5 / 12 * 100%); }
.offset-#{$breakpoint}-6 { margin-left: (6 / 12 * 100%); }
.offset-#{$breakpoint}-7 { margin-left: (7 / 12 * 100%); }
.offset-#{$breakpoint}-8 { margin-left: (8 / 12 * 100%); }
.offset-#{$breakpoint}-9 { margin-left: (9 / 12 * 100%); }
.offset-#{$breakpoint}-10 { margin-left: (10 / 12 * 100%); }
.offset-#{$breakpoint}-11 { margin-left: (11 / 12 * 100%); }
.offset#{$variant}-1 { margin-left: (1 / 12 * 100%) !important; }
.offset#{$variant}-2 { margin-left: (2 / 12 * 100%) !important; }
.offset#{$variant}-3 { margin-left: (3 / 12 * 100%) !important; }
.offset#{$variant}-4 { margin-left: (4 / 12 * 100%) !important; }
.offset#{$variant}-5 { margin-left: (5 / 12 * 100%) !important; }
.offset#{$variant}-6 { margin-left: (6 / 12 * 100%) !important; }
.offset#{$variant}-7 { margin-left: (7 / 12 * 100%) !important; }
.offset#{$variant}-8 { margin-left: (8 / 12 * 100%) !important; }
.offset#{$variant}-9 { margin-left: (9 / 12 * 100%) !important; }
.offset#{$variant}-10 { margin-left: (10 / 12 * 100%) !important; }
.offset#{$variant}-11 { margin-left: (11 / 12 * 100%) !important; }
}
}

0 comments on commit 11fe822

Please sign in to comment.