Skip to content

Commit 6ab2503

Browse files
jzinntw15egankodiakhq[bot]
authored
Run npx sass-migrator division **/*.scss (#11753)
Co-authored-by: TJ Egan <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 6aa84ec commit 6ab2503

File tree

8 files changed

+21
-130
lines changed

8 files changed

+21
-130
lines changed

packages/grid/scss/_css-grid.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,21 @@
247247
$span: $columns * 0.75;
248248
--cds-grid-columns: #{$span};
249249

250-
grid-column: span #{$span} / span #{$span};
250+
grid-column: span list.slash($span, span) #{$span};
251251
}
252252

253253
.#{$prefix}--#{$name}\:col-span-50 {
254254
$span: $columns * 0.5;
255255
--cds-grid-columns: #{$span};
256256

257-
grid-column: span #{$span} / span #{$span};
257+
grid-column: span list.slash($span, span) #{$span};
258258
}
259259

260260
.#{$prefix}--#{$name}\:col-span-25 {
261261
$span: $columns * 0.25;
262262
--cds-grid-columns: #{$span};
263263

264-
grid-column: span #{$span} / span #{$span};
264+
grid-column: span list.slash($span, span) #{$span};
265265
}
266266
} @else {
267267
@include breakpoint($name) {
@@ -279,21 +279,21 @@
279279
$span: $columns * 0.75;
280280
--cds-grid-columns: #{$span};
281281

282-
grid-column: span #{$span} / span #{$span};
282+
grid-column: span list.slash($span, span) #{$span};
283283
}
284284

285285
.#{$prefix}--#{$name}\:col-span-50 {
286286
$span: $columns * 0.5;
287287
--cds-grid-columns: #{$span};
288288

289-
grid-column: span #{$span} / span #{$span};
289+
grid-column: span list.slash($span, span) #{$span};
290290
}
291291

292292
.#{$prefix}--#{$name}\:col-span-25 {
293293
$span: $columns * 0.25;
294294
--cds-grid-columns: #{$span};
295295

296-
grid-column: span #{$span} / span #{$span};
296+
grid-column: span list.slash($span, span) #{$span};
297297
}
298298
}
299299
}
@@ -426,7 +426,7 @@
426426
@if is-smallest-breakpoint($key, $breakpoints) {
427427
--cds-grid-columns: #{$span};
428428

429-
grid-column: span #{$span} / span #{$span};
429+
grid-column: span list.slash($span, span) #{$span};
430430
} @else {
431431
$previous-breakpoint: breakpoint-prev($key, $breakpoints);
432432
$previous-column-count: get-column-count(
@@ -439,7 +439,7 @@
439439
@include breakpoint($key) {
440440
--cds-grid-columns: #{$span};
441441

442-
grid-column: span #{$span} / span #{$span};
442+
grid-column: span list.slash($span, span) #{$span};
443443
}
444444
}
445445
}

packages/grid/scss/_flex-grid.scss

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,8 @@
7070
// Add a `max-width` to ensure content within each column does not blow out
7171
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
7272
// do not appear to require this.
73-
@if meta.function-exists('div', 'math') {
74-
max-width: math.percentage(math.div($span, $columns));
75-
flex: 0 0 math.percentage(math.div($span, $columns));
76-
} @else {
77-
max-width: math.percentage(($span / $columns));
78-
flex: 0 0 math.percentage(($span / $columns));
79-
}
73+
max-width: math.percentage(math.div($span, $columns));
74+
flex: 0 0 math.percentage(math.div($span, $columns));
8075
}
8176
}
8277

@@ -87,11 +82,7 @@
8782
/// @group @carbon/grid
8883
@mixin -make-col-offset($span, $columns) {
8984
$offset: 0;
90-
@if meta.function-exists('div', 'math') {
91-
$offset: math.div($span, $columns);
92-
} @else {
93-
$offset: ($span / $columns);
94-
}
85+
$offset: math.div($span, $columns);
9586
@if $offset == 0 {
9687
margin-left: 0;
9788
} @else {

packages/grid/scss/_mixins.scss

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,8 @@
6464
// Add a `max-width` to ensure content within each column does not blow out
6565
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
6666
// do not appear to require this.
67-
@if meta.function-exists('div', 'math') {
68-
max-width: math.percentage(math.div($span, $columns));
69-
flex: 0 0 math.percentage(math.div($span, $columns));
70-
} @else {
71-
max-width: math.percentage(($span / $columns));
72-
flex: 0 0 math.percentage(($span / $columns));
73-
}
67+
max-width: math.percentage(math.div($span, $columns));
68+
flex: 0 0 math.percentage(math.div($span, $columns));
7469
}
7570
}
7671

@@ -81,11 +76,7 @@
8176
/// @group @carbon/grid
8277
@mixin -make-col-offset($span, $columns) {
8378
$offset: 0;
84-
@if meta.function-exists('div', 'math') {
85-
$offset: math.div($span, $columns);
86-
} @else {
87-
$offset: ($span / $columns);
88-
}
79+
$offset: math.div($span, $columns);
8980
@if $offset == 0 {
9081
margin-left: 0;
9182
} @else {

packages/layout/scss/_convert.import.scss

Lines changed: 0 additions & 63 deletions
This file was deleted.

packages/layout/scss/_convert.scss

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ $base-font-size: 16px !default;
2424
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
2525
}
2626

27-
@if meta.function-exists('div', 'math') {
28-
@return math.div($px, $base-font-size) * 1rem;
29-
} @else {
30-
@return ($px / $base-font-size) * 1rem;
31-
}
27+
@return math.div($px, $base-font-size) * 1rem;
3228
}
3329

3430
/// Convert a given px unit to a em unit
@@ -41,9 +37,5 @@ $base-font-size: 16px !default;
4137
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
4238
}
4339

44-
@if meta.function-exists('div', 'math') {
45-
@return math.div($px, $base-font-size) * 1em;
46-
} @else {
47-
@return ($px / $base-font-size) * 1em;
48-
}
40+
@return math.div($px, $base-font-size) * 1em;
4941
}

packages/layout/scss/modules/_convert.scss

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ $base-font-size: 16px !default;
2424
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
2525
}
2626

27-
@if meta.function-exists('div', 'math') {
28-
@return math.div($px, $base-font-size) * 1rem;
29-
} @else {
30-
@return ($px / $base-font-size) * 1rem;
31-
}
27+
@return math.div($px, $base-font-size) * 1rem;
3228
}
3329

3430
/// Convert a given px unit to a em unit
@@ -41,9 +37,5 @@ $base-font-size: 16px !default;
4137
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
4238
}
4339

44-
@if meta.function-exists('div', 'math') {
45-
@return math.div($px, $base-font-size) * 1em;
46-
} @else {
47-
@return ($px / $base-font-size) * 1em;
48-
}
40+
@return math.div($px, $base-font-size) * 1em;
4941
}

packages/styles/scss/components/aspect-ratio/_aspect-ratio.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ $aspect-ratios: (
6363
$height: list.nth($aspect-ratio, 2);
6464

6565
.#{$prefix}--aspect-ratio--#{$width}x#{$height}::before {
66-
@if meta.function-exists('div', 'math') {
67-
padding-top: math.percentage(math.div($height, $width));
68-
} @else {
69-
padding-top: math.percentage(($height / $width));
70-
}
66+
padding-top: math.percentage(math.div($height, $width));
7167
}
7268
}
7369
}

packages/styles/scss/utilities/_convert.scss

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ $base-font-size: 16px !default;
2323
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
2424
}
2525

26-
@if meta.function-exists('div', 'math') {
27-
@return math.div($px, $base-font-size) * 1rem;
28-
} @else {
29-
@return ($px / $base-font-size) * 1rem;
30-
}
26+
@return math.div($px, $base-font-size) * 1rem;
3127
}
3228

3329
/// Convert a given px unit to a em unit
@@ -40,9 +36,5 @@ $base-font-size: 16px !default;
4036
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
4137
}
4238

43-
@if meta.function-exists('div', 'math') {
44-
@return math.div($px, $base-font-size) * 1em;
45-
} @else {
46-
@return ($px / $base-font-size) * 1em;
47-
}
39+
@return math.div($px, $base-font-size) * 1em;
4840
}

0 commit comments

Comments
 (0)