Skip to content

Commit

Permalink
refactor(grid): improve name of grid modifier mixin, update existing …
Browse files Browse the repository at this point in the history
…mixins to use new mixin

BREAKING CHANGE: Any existing implementations that use `create-grid-wrap-modifier` should be updated
to `grid-wrap-modifier`

re #33
  • Loading branch information
larrybotha committed Apr 18, 2022
1 parent e33a528 commit 727b1bb
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions scss/core/tools/mixins/components/grid/_grid-wraps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@
}
}

@mixin create-grid-wrap-modifier($modifier, $classname: $grid-wrap-classname) {
@mixin grid-wrap($classname: $grid-wrap-classname) {
.#{$classname} { @extend %grid-wrap;}
}

@mixin grid-wrap-modifier($modifier, $classname: $grid-wrap-classname) {
.#{$classname}--#{$modifier} {
@content;
}
}

@mixin grid-wrap($classname: $grid-wrap-classname) {
.#{$classname} { @extend %grid-wrap;}
}

@mixin grid-wrap--reverse($classname: $grid-wrap-classname) {
/**
* reversed grids
*/
.#{$classname}--reverse {
@include grid-wrap-modifier(reverse) {
@extend %grid-wrap;

@if $use-legacy-grid {
Expand Down Expand Up @@ -89,7 +89,7 @@
* centered grids align grid items centrally without needing to use push or pull
* classes.
*/
.#{$classname}--center {
@include grid-wrap-modifier(center) {
@extend %grid-wrap;

@if $use-legacy-grid {
Expand All @@ -110,7 +110,7 @@
/**
* inline-end aligned grids (right-aligned in ltr layouts, else left-aligned)
*/
.#{$classname}--inline-end {
@include grid-wrap-modifier(inline-end) {
@extend %grid-wrap;

@if $use-legacy-grid {
Expand All @@ -132,7 +132,7 @@
/**
* middle aligned grids
*/
.#{$classname}--middle {
@include grid-wrap-modifier(middle) {
@extend %grid-wrap;

@if $use-flexbox-grid { align-items: center;}
Expand All @@ -150,7 +150,7 @@
/**
* bottom aligned grids
*/
.#{$classname}--block-end {
@include grid-wrap-modifier(block-end) {
@extend %grid-wrap;

@if $use-flexbox-grid { align-items: flex-end;}
Expand All @@ -162,6 +162,8 @@
}
}
}


@mixin grid-wrap-gutter-modifier($modifier, $size, $classname: $grid-wrap-classname) {
@include grid-wrap-modifier($modifier, $classname: $grid-wrap-classname) {
@extend %grid-wrap;
Expand All @@ -177,3 +179,4 @@
*/
@include grid-wrap-gutter-modifier('no-gutter', 0);
}

0 comments on commit 727b1bb

Please sign in to comment.