Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit c04a52e

Browse files
committed
fix(scss): fix importance of 0 and 0--only classes
1 parent 7cd3388 commit c04a52e

File tree

13 files changed

+38
-55
lines changed

13 files changed

+38
-55
lines changed

bin/src/scss/_mixins.scss

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,26 +170,21 @@
170170

171171
// Generate all classes for 0 and 0-only displaying, including custom breakpoints if they exist
172172
@mixin gridLegacyZeros($breakpoint, $breakpoints, $name) {
173-
// Undo previous breakpoint’s 0-only class
173+
// Undo previous breakpoint’s 0--only class
174174
$onlyCorrectionFound: false;
175175
@for $i from length($breakpoints) *-1 through -1 {
176176
$currentBreakpoint: nth($breakpoints, $i);
177177
@if map-get(nth($currentBreakpoint, 2), breakpoint) < map-get($breakpoint, breakpoint) and $onlyCorrectionFound == false {
178-
.#{$prefix}-grid__col--#{nth($currentBreakpoint, 1)}--0-only {
178+
.#{$prefix}-grid__col--#{nth($currentBreakpoint, 1)}--0--only {
179179
display: flex;
180180
}
181181

182182
$onlyCorrectionFound: true;
183183
}
184184
}
185185

186-
// Undo previous breakpoint’s 0 class
187-
@each $currentBreakpoint in $breakpoints {
188-
@if map-get(nth($currentBreakpoint, 2), breakpoint) < map-get($breakpoint, breakpoint) {
189-
[class*="#{$prefix}-grid__col--#{nth($currentBreakpoint, 1)}--0"][class*="#{$prefix}-grid__col--#{$name}--"] {
190-
display: flex;
191-
}
192-
}
186+
[class*="#{$prefix}-grid__col--#{$name}--"] {
187+
display: flex;
193188
}
194189

195190
.#{$prefix}-grid__col--#{$name}--0,
Binary file not shown.

examples/bootstrap/css-gridish/css/bootstrap-grid-legacy.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ body {
4747
.bootstrap-grid > * {
4848
width: initial; } }
4949

50+
[class*="bootstrap-grid__col--sm--"] {
51+
display: flex; }
52+
5053
.bootstrap-grid__col--sm--0,
5154
.bootstrap-grid__col--sm--0--only {
5255
display: none; }
@@ -313,9 +316,9 @@ body {
313316
--bootstrap-height-29: 29rem; } }
314317

315318
@media (min-width: 100rem) {
316-
.bootstrap-grid__col--sm--0-only {
319+
.bootstrap-grid__col--sm--0--only {
317320
display: flex; }
318-
[class*="bootstrap-grid__col--sm--0"][class*="bootstrap-grid__col--xl--"] {
321+
[class*="bootstrap-grid__col--xl--"] {
319322
display: flex; }
320323
.bootstrap-grid__col--xl--0,
321324
.bootstrap-grid__col--xl--0--only {

examples/bootstrap/css-gridish/css/bootstrap-grid-legacy.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/bootstrap/css-gridish/scss/_mixins.scss

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,26 +170,21 @@
170170

171171
// Generate all classes for 0 and 0-only displaying, including custom breakpoints if they exist
172172
@mixin gridLegacyZeros($breakpoint, $breakpoints, $name) {
173-
// Undo previous breakpoint’s 0-only class
173+
// Undo previous breakpoint’s 0--only class
174174
$onlyCorrectionFound: false;
175175
@for $i from length($breakpoints) *-1 through -1 {
176176
$currentBreakpoint: nth($breakpoints, $i);
177177
@if map-get(nth($currentBreakpoint, 2), breakpoint) < map-get($breakpoint, breakpoint) and $onlyCorrectionFound == false {
178-
.#{$prefix}-grid__col--#{nth($currentBreakpoint, 1)}--0-only {
178+
.#{$prefix}-grid__col--#{nth($currentBreakpoint, 1)}--0--only {
179179
display: flex;
180180
}
181181

182182
$onlyCorrectionFound: true;
183183
}
184184
}
185185

186-
// Undo previous breakpoint’s 0 class
187-
@each $currentBreakpoint in $breakpoints {
188-
@if map-get(nth($currentBreakpoint, 2), breakpoint) < map-get($breakpoint, breakpoint) {
189-
[class*="#{$prefix}-grid__col--#{nth($currentBreakpoint, 1)}--0"][class*="#{$prefix}-grid__col--#{$name}--"] {
190-
display: flex;
191-
}
192-
}
186+
[class*="#{$prefix}-grid__col--#{$name}--"] {
187+
display: flex;
193188
}
194189

195190
.#{$prefix}-grid__col--#{$name}--0,
0 Bytes
Binary file not shown.

examples/carbon/css-gridish/css/bx-grid-legacy.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ body {
4747
.bx-grid > * {
4848
width: initial; } }
4949

50+
[class*="bx-grid__col--sm--"] {
51+
display: flex; }
52+
5053
.bx-grid__col--sm--0,
5154
.bx-grid__col--sm--0--only {
5255
display: none; }
@@ -338,9 +341,9 @@ body {
338341
--bx-height-29: 14.5rem; } }
339342

340343
@media (min-width: 100rem) {
341-
.bx-grid__col--sm--0-only {
344+
.bx-grid__col--sm--0--only {
342345
display: flex; }
343-
[class*="bx-grid__col--sm--0"][class*="bx-grid__col--xxl--"] {
346+
[class*="bx-grid__col--xxl--"] {
344347
display: flex; }
345348
.bx-grid__col--xxl--0,
346349
.bx-grid__col--xxl--0--only {

0 commit comments

Comments
 (0)