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

Commit 3c2c7bd

Browse files
authored
Merge pull request #7 from IBM/marginBugFix
fix(scss): avoid skipping margin if it repeats size in breakpoints
2 parents 6e7e37f + 814f9ce commit 3c2c7bd

28 files changed

+182
-159
lines changed

bin/src/scss/_core.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ body {
8585
}
8686
}
8787

88-
@if (map-has-key($cleanedBreakpoints, $name)) {
88+
@if (map-has-key($allBreakpoints, $name)) {
8989
@include gridMargin($breakpoint, $last);
9090
@include gridPadding($breakpoint);
9191
@include gridLegacyWrapper($includeFlexFallback) {

bin/src/scss/_functions.scss

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,36 +62,6 @@
6262
@return maps-sort($allBreakpoints, breakpoint);
6363
}
6464

65-
@function cleanBreakpoint($name, $breakpoint) {
66-
$cleanBreakpoint: $breakpoint;
67-
$previousKey: index(map-keys($breakpoints), $name) - 1;
68-
69-
@if $previousKey != 0 {
70-
$prevMap: nth(nth($breakpoints, $previousKey), 2);
71-
72-
@each $key, $value in $breakpoint {
73-
@if $value == map-get($prevMap, $key) {
74-
$cleanBreakpoint: map-remove($cleanBreakpoint, $key);
75-
}
76-
}
77-
}
78-
79-
@return ($name: map-merge($cleanBreakpoint, (columns: map-get($breakpoint, columns))));
80-
}
81-
82-
@function cleanBreakpoints($breakpoints) {
83-
$cleanBreakpoints: $breakpoints;
84-
85-
@each $name, $breakpoint in $breakpoints {
86-
$cleanBreakpoints: map-merge(
87-
$cleanBreakpoints,
88-
cleanBreakpoint($name, $breakpoint)
89-
);
90-
}
91-
92-
@return $cleanBreakpoints;
93-
}
94-
9565
@function columnStringWidth($string, $multiple) {
9666
@return 1rem;
9767
}

bin/src/scss/_variables.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@ $prefix: gridish !default;
66
}
77
$extraBreakpoints: () !default;
88
$breakpoints: addPadding(map-get($grid-values, "breakpoints"));
9-
$cleanedBreakpoints: cleanBreakpoints($breakpoints);
109
$first: nth(nth($breakpoints, 1), 2);
1110
$last: nth(nth($breakpoints, -1), 2);
1211
$includeFlexFallback: false !default;
1312
$rowHeight: map-get($grid-values, "rowHeight");
1413
$rows: map-get($grid-values, "rows");
15-
$allBreakpoints: allBreakpoints(
16-
$cleanedBreakpoints,
17-
$extraBreakpoints,
18-
$first,
19-
$last
20-
);
14+
$allBreakpoints: allBreakpoints($breakpoints, $extraBreakpoints, $first, $last);
Binary file not shown.

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,22 @@ body {
323323
display: none; }
324324
[class*="bootstrap-grid__col--"] {
325325
min-width: 0; }
326+
.bootstrap-padding {
327+
padding: calc(30px / 2); }
328+
.bootstrap-padding--bottom {
329+
padding-bottom: calc(30px / 2); }
330+
.bootstrap-padding--left {
331+
padding-left: calc(30px / 2); }
332+
.bootstrap-padding--right {
333+
padding-right: calc(30px / 2); }
334+
.bootstrap-padding--top {
335+
padding-top: calc(30px / 2); }
336+
.bootstrap-padding--horizontal {
337+
padding-left: calc(30px / 2);
338+
padding-right: calc(30px / 2); }
339+
.bootstrap-padding--vertical {
340+
padding-bottom: calc(30px / 2);
341+
padding-top: calc(30px / 2); }
326342
@supports (display: grid) {
327343
.bootstrap-grid {
328344
grid-template-columns: repeat(auto-fill, calc( 100rem / 12)); }

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/css/bootstrap-grid.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,22 @@ body {
9696
--bootstrap-height-29: 29rem; }
9797

9898
@media (min-width: 100rem) {
99+
.bootstrap-padding {
100+
padding: calc(30px / 2); }
101+
.bootstrap-padding--bottom {
102+
padding-bottom: calc(30px / 2); }
103+
.bootstrap-padding--left {
104+
padding-left: calc(30px / 2); }
105+
.bootstrap-padding--right {
106+
padding-right: calc(30px / 2); }
107+
.bootstrap-padding--top {
108+
padding-top: calc(30px / 2); }
109+
.bootstrap-padding--horizontal {
110+
padding-left: calc(30px / 2);
111+
padding-right: calc(30px / 2); }
112+
.bootstrap-padding--vertical {
113+
padding-bottom: calc(30px / 2);
114+
padding-top: calc(30px / 2); }
99115
.bootstrap-grid {
100116
grid-template-columns: repeat(auto-fill, calc( 100rem / 12)); }
101117
.bootstrap-grid.bootstrap-grid--fixed-columns {

0 commit comments

Comments
 (0)