@carbon/grid 10.38.0 → 10.39.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/scss/_inlined/_mixins.import.scss +38 -23
- package/scss/_mixins.import.scss +38 -23
- package/scss/modules/_css-grid.scss +6 -1
- package/scss/modules/_mixins.scss +14 -3
- package/scss/vendor/@carbon/layout/_convert.import.scss +11 -2
- package/scss/vendor/@carbon/layout/_key-height.import.scss +6 -1
- package/scss/vendor/@carbon/layout/modules/_convert.scss +11 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/grid",
|
|
3
3
|
"description": "Grid for digital and software products using the Carbon Design System",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.39.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@carbon/import-once": "^10.6.0",
|
|
36
|
-
"@carbon/layout": "^10.
|
|
36
|
+
"@carbon/layout": "^10.34.0-rc.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@carbon/cli": "^10.30.0",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"sassDir": "scss",
|
|
46
46
|
"needs": "^1.3.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "b5f01ac2dbf9e5acb901cfc939b4ddd4d951a35e"
|
|
49
49
|
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
// and often derived from, bootstrap:
|
|
24
24
|
// https://github.com/twbs/bootstrap/blob/v4-dev/scss/mixins/_grid.scss
|
|
25
25
|
|
|
26
|
+
@use 'sass:meta';
|
|
26
27
|
@use 'sass:math';
|
|
27
28
|
@import '../vendor/@carbon/layout/breakpoint'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
28
29
|
@import 'prefix'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
@@ -46,21 +47,21 @@
|
|
|
46
47
|
// always setting `width: 100%;`. This works because we use `flex` values
|
|
47
48
|
// later on to override this initial width.
|
|
48
49
|
width: 100%;
|
|
49
|
-
padding-right:
|
|
50
|
-
padding-left:
|
|
50
|
+
padding-right: $gutter * 0.5;
|
|
51
|
+
padding-left: $gutter * 0.5;
|
|
51
52
|
|
|
52
53
|
// For our condensed use-case, our gutters collapse to 2px solid, 1px on each
|
|
53
54
|
// side.
|
|
54
55
|
.#{$prefix}--row--condensed &,
|
|
55
56
|
.#{$prefix}--grid--condensed & {
|
|
56
|
-
padding-right:
|
|
57
|
-
padding-left:
|
|
57
|
+
padding-right: $condensed-gutter * 0.5;
|
|
58
|
+
padding-left: $condensed-gutter * 0.5;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
// For our narrow use-case, our container hangs 16px into the gutter
|
|
61
62
|
.#{$prefix}--row--narrow &,
|
|
62
63
|
.#{$prefix}--grid--narrow & {
|
|
63
|
-
padding-right:
|
|
64
|
+
padding-right: $gutter * 0.5;
|
|
64
65
|
padding-left: 0;
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -80,8 +81,13 @@
|
|
|
80
81
|
// Add a `max-width` to ensure content within each column does not blow out
|
|
81
82
|
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
|
|
82
83
|
// do not appear to require this.
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
@if meta.function-exists('div', 'math') {
|
|
85
|
+
max-width: percentage(math.div($span, $columns));
|
|
86
|
+
flex: 0 0 percentage(math.div($span, $columns));
|
|
87
|
+
} @else {
|
|
88
|
+
max-width: percentage(($span / $columns));
|
|
89
|
+
flex: 0 0 percentage(($span / $columns));
|
|
90
|
+
}
|
|
85
91
|
}
|
|
86
92
|
}
|
|
87
93
|
|
|
@@ -91,7 +97,12 @@
|
|
|
91
97
|
/// @access private
|
|
92
98
|
/// @group @carbon/grid
|
|
93
99
|
@mixin carbon--make-col-offset($span, $columns) {
|
|
94
|
-
$offset:
|
|
100
|
+
$offset: 0;
|
|
101
|
+
@if meta.function-exists('div', 'math') {
|
|
102
|
+
$offset: math.div($span, $columns);
|
|
103
|
+
} @else {
|
|
104
|
+
$offset: ($span / $columns);
|
|
105
|
+
}
|
|
95
106
|
@if $offset == 0 {
|
|
96
107
|
margin-left: 0;
|
|
97
108
|
} @else {
|
|
@@ -173,8 +184,8 @@
|
|
|
173
184
|
@mixin carbon--make-row($gutter: $carbon--grid-gutter) {
|
|
174
185
|
display: flex;
|
|
175
186
|
flex-wrap: wrap;
|
|
176
|
-
margin-right: -1 *
|
|
177
|
-
margin-left: -1 *
|
|
187
|
+
margin-right: -1 * $gutter * 0.5;
|
|
188
|
+
margin-left: -1 * $gutter * 0.5;
|
|
178
189
|
}
|
|
179
190
|
|
|
180
191
|
// -----------------------------------------------------------------------------
|
|
@@ -225,20 +236,20 @@
|
|
|
225
236
|
/// @group @carbon/grid
|
|
226
237
|
@mixin carbon--hang($gutter: $carbon--grid-gutter) {
|
|
227
238
|
.#{$prefix}--hang--start {
|
|
228
|
-
padding-left:
|
|
239
|
+
padding-left: $gutter * 0.5;
|
|
229
240
|
}
|
|
230
241
|
|
|
231
242
|
.#{$prefix}--hang--end {
|
|
232
|
-
padding-right:
|
|
243
|
+
padding-right: $gutter * 0.5;
|
|
233
244
|
}
|
|
234
245
|
|
|
235
246
|
// Deprecated ☠️
|
|
236
247
|
.#{$prefix}--hang--left {
|
|
237
|
-
padding-left:
|
|
248
|
+
padding-left: $gutter * 0.5;
|
|
238
249
|
}
|
|
239
250
|
|
|
240
251
|
.#{$prefix}--hang--right {
|
|
241
|
-
padding-right:
|
|
252
|
+
padding-right: $gutter * 0.5;
|
|
242
253
|
}
|
|
243
254
|
}
|
|
244
255
|
|
|
@@ -299,7 +310,11 @@ $carbon--aspect-ratios: (
|
|
|
299
310
|
$height: nth($aspect-ratio, 2);
|
|
300
311
|
|
|
301
312
|
.#{$prefix}--aspect-ratio--#{$width}x#{$height}::before {
|
|
302
|
-
|
|
313
|
+
@if meta.function-exists('div', 'math') {
|
|
314
|
+
padding-top: percentage(math.div($height, $width));
|
|
315
|
+
} @else {
|
|
316
|
+
padding-top: percentage(($height / $width));
|
|
317
|
+
}
|
|
303
318
|
}
|
|
304
319
|
}
|
|
305
320
|
|
|
@@ -336,14 +351,14 @@ $carbon--aspect-ratios: (
|
|
|
336
351
|
$prev-margin: map-get($prev-breakpoint, margin);
|
|
337
352
|
@if $prev-margin != $margin {
|
|
338
353
|
@include carbon--breakpoint($name) {
|
|
339
|
-
padding-right: #{
|
|
340
|
-
padding-left: #{
|
|
354
|
+
padding-right: #{($carbon--grid-gutter * 0.5) + $margin};
|
|
355
|
+
padding-left: #{($carbon--grid-gutter * 0.5) + $margin};
|
|
341
356
|
}
|
|
342
357
|
}
|
|
343
358
|
} @else {
|
|
344
359
|
@include carbon--breakpoint($name) {
|
|
345
|
-
padding-right: #{
|
|
346
|
-
padding-left: #{
|
|
360
|
+
padding-right: #{($carbon--grid-gutter * 0.5) + $margin};
|
|
361
|
+
padding-left: #{($carbon--grid-gutter * 0.5) + $margin};
|
|
347
362
|
}
|
|
348
363
|
}
|
|
349
364
|
}
|
|
@@ -400,13 +415,13 @@ $carbon--aspect-ratios: (
|
|
|
400
415
|
|
|
401
416
|
.#{$prefix}--row-padding [class*='#{$prefix}--col'],
|
|
402
417
|
.#{$prefix}--col-padding {
|
|
403
|
-
padding-top:
|
|
404
|
-
padding-bottom:
|
|
418
|
+
padding-top: $grid-gutter * 0.5;
|
|
419
|
+
padding-bottom: $grid-gutter * 0.5;
|
|
405
420
|
}
|
|
406
421
|
|
|
407
422
|
.#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
|
|
408
|
-
padding-top:
|
|
409
|
-
padding-bottom:
|
|
423
|
+
padding-top: $condensed-gutter * 0.5;
|
|
424
|
+
padding-bottom: $condensed-gutter * 0.5;
|
|
410
425
|
}
|
|
411
426
|
|
|
412
427
|
@include carbon--make-grid-columns($breakpoints, $grid-gutter);
|
package/scss/_mixins.import.scss
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
// and often derived from, bootstrap:
|
|
24
24
|
// https://github.com/twbs/bootstrap/blob/v4-dev/scss/mixins/_grid.scss
|
|
25
25
|
|
|
26
|
+
@use 'sass:meta';
|
|
26
27
|
@use 'sass:math';
|
|
27
28
|
@import '@carbon/layout/scss/breakpoint'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
28
29
|
@import 'prefix'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
@@ -46,21 +47,21 @@
|
|
|
46
47
|
// always setting `width: 100%;`. This works because we use `flex` values
|
|
47
48
|
// later on to override this initial width.
|
|
48
49
|
width: 100%;
|
|
49
|
-
padding-right:
|
|
50
|
-
padding-left:
|
|
50
|
+
padding-right: $gutter * 0.5;
|
|
51
|
+
padding-left: $gutter * 0.5;
|
|
51
52
|
|
|
52
53
|
// For our condensed use-case, our gutters collapse to 2px solid, 1px on each
|
|
53
54
|
// side.
|
|
54
55
|
.#{$prefix}--row--condensed &,
|
|
55
56
|
.#{$prefix}--grid--condensed & {
|
|
56
|
-
padding-right:
|
|
57
|
-
padding-left:
|
|
57
|
+
padding-right: $condensed-gutter * 0.5;
|
|
58
|
+
padding-left: $condensed-gutter * 0.5;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
// For our narrow use-case, our container hangs 16px into the gutter
|
|
61
62
|
.#{$prefix}--row--narrow &,
|
|
62
63
|
.#{$prefix}--grid--narrow & {
|
|
63
|
-
padding-right:
|
|
64
|
+
padding-right: $gutter * 0.5;
|
|
64
65
|
padding-left: 0;
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -80,8 +81,13 @@
|
|
|
80
81
|
// Add a `max-width` to ensure content within each column does not blow out
|
|
81
82
|
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
|
|
82
83
|
// do not appear to require this.
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
@if meta.function-exists('div', 'math') {
|
|
85
|
+
max-width: percentage(math.div($span, $columns));
|
|
86
|
+
flex: 0 0 percentage(math.div($span, $columns));
|
|
87
|
+
} @else {
|
|
88
|
+
max-width: percentage(($span / $columns));
|
|
89
|
+
flex: 0 0 percentage(($span / $columns));
|
|
90
|
+
}
|
|
85
91
|
}
|
|
86
92
|
}
|
|
87
93
|
|
|
@@ -91,7 +97,12 @@
|
|
|
91
97
|
/// @access private
|
|
92
98
|
/// @group @carbon/grid
|
|
93
99
|
@mixin carbon--make-col-offset($span, $columns) {
|
|
94
|
-
$offset:
|
|
100
|
+
$offset: 0;
|
|
101
|
+
@if meta.function-exists('div', 'math') {
|
|
102
|
+
$offset: math.div($span, $columns);
|
|
103
|
+
} @else {
|
|
104
|
+
$offset: ($span / $columns);
|
|
105
|
+
}
|
|
95
106
|
@if $offset == 0 {
|
|
96
107
|
margin-left: 0;
|
|
97
108
|
} @else {
|
|
@@ -173,8 +184,8 @@
|
|
|
173
184
|
@mixin carbon--make-row($gutter: $carbon--grid-gutter) {
|
|
174
185
|
display: flex;
|
|
175
186
|
flex-wrap: wrap;
|
|
176
|
-
margin-right: -1 *
|
|
177
|
-
margin-left: -1 *
|
|
187
|
+
margin-right: -1 * $gutter * 0.5;
|
|
188
|
+
margin-left: -1 * $gutter * 0.5;
|
|
178
189
|
}
|
|
179
190
|
|
|
180
191
|
// -----------------------------------------------------------------------------
|
|
@@ -225,20 +236,20 @@
|
|
|
225
236
|
/// @group @carbon/grid
|
|
226
237
|
@mixin carbon--hang($gutter: $carbon--grid-gutter) {
|
|
227
238
|
.#{$prefix}--hang--start {
|
|
228
|
-
padding-left:
|
|
239
|
+
padding-left: $gutter * 0.5;
|
|
229
240
|
}
|
|
230
241
|
|
|
231
242
|
.#{$prefix}--hang--end {
|
|
232
|
-
padding-right:
|
|
243
|
+
padding-right: $gutter * 0.5;
|
|
233
244
|
}
|
|
234
245
|
|
|
235
246
|
// Deprecated ☠️
|
|
236
247
|
.#{$prefix}--hang--left {
|
|
237
|
-
padding-left:
|
|
248
|
+
padding-left: $gutter * 0.5;
|
|
238
249
|
}
|
|
239
250
|
|
|
240
251
|
.#{$prefix}--hang--right {
|
|
241
|
-
padding-right:
|
|
252
|
+
padding-right: $gutter * 0.5;
|
|
242
253
|
}
|
|
243
254
|
}
|
|
244
255
|
|
|
@@ -299,7 +310,11 @@ $carbon--aspect-ratios: (
|
|
|
299
310
|
$height: nth($aspect-ratio, 2);
|
|
300
311
|
|
|
301
312
|
.#{$prefix}--aspect-ratio--#{$width}x#{$height}::before {
|
|
302
|
-
|
|
313
|
+
@if meta.function-exists('div', 'math') {
|
|
314
|
+
padding-top: percentage(math.div($height, $width));
|
|
315
|
+
} @else {
|
|
316
|
+
padding-top: percentage(($height / $width));
|
|
317
|
+
}
|
|
303
318
|
}
|
|
304
319
|
}
|
|
305
320
|
|
|
@@ -336,14 +351,14 @@ $carbon--aspect-ratios: (
|
|
|
336
351
|
$prev-margin: map-get($prev-breakpoint, margin);
|
|
337
352
|
@if $prev-margin != $margin {
|
|
338
353
|
@include carbon--breakpoint($name) {
|
|
339
|
-
padding-right: #{
|
|
340
|
-
padding-left: #{
|
|
354
|
+
padding-right: #{($carbon--grid-gutter * 0.5) + $margin};
|
|
355
|
+
padding-left: #{($carbon--grid-gutter * 0.5) + $margin};
|
|
341
356
|
}
|
|
342
357
|
}
|
|
343
358
|
} @else {
|
|
344
359
|
@include carbon--breakpoint($name) {
|
|
345
|
-
padding-right: #{
|
|
346
|
-
padding-left: #{
|
|
360
|
+
padding-right: #{($carbon--grid-gutter * 0.5) + $margin};
|
|
361
|
+
padding-left: #{($carbon--grid-gutter * 0.5) + $margin};
|
|
347
362
|
}
|
|
348
363
|
}
|
|
349
364
|
}
|
|
@@ -400,13 +415,13 @@ $carbon--aspect-ratios: (
|
|
|
400
415
|
|
|
401
416
|
.#{$prefix}--row-padding [class*='#{$prefix}--col'],
|
|
402
417
|
.#{$prefix}--col-padding {
|
|
403
|
-
padding-top:
|
|
404
|
-
padding-bottom:
|
|
418
|
+
padding-top: $grid-gutter * 0.5;
|
|
419
|
+
padding-bottom: $grid-gutter * 0.5;
|
|
405
420
|
}
|
|
406
421
|
|
|
407
422
|
.#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
|
|
408
|
-
padding-top:
|
|
409
|
-
padding-bottom:
|
|
423
|
+
padding-top: $condensed-gutter * 0.5;
|
|
424
|
+
padding-bottom: $condensed-gutter * 0.5;
|
|
410
425
|
}
|
|
411
426
|
|
|
412
427
|
@include carbon--make-grid-columns($breakpoints, $grid-gutter);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
+
@use 'sass:meta';
|
|
8
9
|
@use "sass:math";
|
|
9
10
|
|
|
10
11
|
@use 'sass:map';
|
|
@@ -405,7 +406,11 @@ $carbon--aspect-ratios: (
|
|
|
405
406
|
$height: nth($aspect-ratio, 2);
|
|
406
407
|
|
|
407
408
|
.#{$prefix}--aspect-ratio--#{$width}x#{$height}::before {
|
|
408
|
-
|
|
409
|
+
@if meta.function-exists('div', 'math') {
|
|
410
|
+
padding-top: percentage(math.div($height, $width));
|
|
411
|
+
} @else {
|
|
412
|
+
padding-top: percentage(($height / $width));
|
|
413
|
+
}
|
|
409
414
|
}
|
|
410
415
|
}
|
|
411
416
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
+
@use 'sass:meta';
|
|
8
9
|
@use "sass:math";
|
|
9
10
|
|
|
10
11
|
@use 'config' as *;
|
|
@@ -63,8 +64,13 @@
|
|
|
63
64
|
// Add a `max-width` to ensure content within each column does not blow out
|
|
64
65
|
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
|
|
65
66
|
// do not appear to require this.
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
@if meta.function-exists('div', 'math') {
|
|
68
|
+
max-width: percentage(math.div($span, $columns));
|
|
69
|
+
flex: 0 0 percentage(math.div($span, $columns));
|
|
70
|
+
} @else {
|
|
71
|
+
max-width: percentage(($span / $columns));
|
|
72
|
+
flex: 0 0 percentage(($span / $columns));
|
|
73
|
+
}
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
76
|
|
|
@@ -74,7 +80,12 @@
|
|
|
74
80
|
/// @access private
|
|
75
81
|
/// @group @carbon/grid
|
|
76
82
|
@mixin -make-col-offset($span, $columns) {
|
|
77
|
-
$offset:
|
|
83
|
+
$offset: 0;
|
|
84
|
+
@if meta.function-exists('div', 'math') {
|
|
85
|
+
$offset: math.div($span, $columns);
|
|
86
|
+
} @else {
|
|
87
|
+
$offset: ($span / $columns);
|
|
88
|
+
}
|
|
78
89
|
@if $offset == 0 {
|
|
79
90
|
margin-left: 0;
|
|
80
91
|
} @else {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
// compatibility file to ensure we continue to support node-sass and dart-sass
|
|
20
20
|
// in v10.
|
|
21
21
|
|
|
22
|
+
@use 'sass:meta';
|
|
22
23
|
@use 'sass:math';
|
|
23
24
|
|
|
24
25
|
/// Default font size
|
|
@@ -38,7 +39,11 @@ $carbon--base-font-size: 16px !default;
|
|
|
38
39
|
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
@
|
|
42
|
+
@if meta.function-exists('div', 'math') {
|
|
43
|
+
@return math.div($px, $carbon--base-font-size) * 1rem;
|
|
44
|
+
} @else {
|
|
45
|
+
@return ($px / $carbon--base-font-size) * 1rem;
|
|
46
|
+
}
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
/// Convert a given px unit to a em unit
|
|
@@ -52,5 +57,9 @@ $carbon--base-font-size: 16px !default;
|
|
|
52
57
|
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
|
|
53
58
|
}
|
|
54
59
|
|
|
55
|
-
@
|
|
60
|
+
@if meta.function-exists('div', 'math') {
|
|
61
|
+
@return math.div($px, $carbon--base-font-size) * 1em;
|
|
62
|
+
} @else {
|
|
63
|
+
@return ($px / $carbon--base-font-size) * 1em;
|
|
64
|
+
}
|
|
56
65
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
// compatibility file to ensure we continue to support node-sass and dart-sass
|
|
20
20
|
// in v10.
|
|
21
21
|
|
|
22
|
+
@use 'sass:meta';
|
|
22
23
|
@use "sass:math";
|
|
23
24
|
@import 'breakpoint'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
24
25
|
@import 'utilities'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
@@ -39,7 +40,11 @@
|
|
|
39
40
|
$margin: map-get($values, margin);
|
|
40
41
|
$columns: map-get($values, columns);
|
|
41
42
|
|
|
42
|
-
@
|
|
43
|
+
@if meta.function-exists('div', 'math') {
|
|
44
|
+
@return math.div($width - (2 * $margin), $columns);
|
|
45
|
+
} @else {
|
|
46
|
+
@return (($width - (2 * $margin)) / $columns);
|
|
47
|
+
}
|
|
43
48
|
} @else {
|
|
44
49
|
@warn 'Breakpoint: `#{$breakpoint}` is not a valid breakpoint.';
|
|
45
50
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
+
@use 'sass:meta';
|
|
8
9
|
@use 'sass:math';
|
|
9
10
|
|
|
10
11
|
/// Default font size
|
|
@@ -24,7 +25,11 @@ $base-font-size: 16px !default;
|
|
|
24
25
|
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
@
|
|
28
|
+
@if meta.function-exists('div', 'math') {
|
|
29
|
+
@return math.div($px, $base-font-size) * 1rem;
|
|
30
|
+
} @else {
|
|
31
|
+
@return ($px / $base-font-size) * 1rem;
|
|
32
|
+
}
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
/// Convert a given px unit to a em unit
|
|
@@ -38,5 +43,9 @@ $base-font-size: 16px !default;
|
|
|
38
43
|
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
@
|
|
46
|
+
@if meta.function-exists('div', 'math') {
|
|
47
|
+
@return math.div($px, $base-font-size) * 1em;
|
|
48
|
+
} @else {
|
|
49
|
+
@return ($px / $base-font-size) * 1em;
|
|
50
|
+
}
|
|
42
51
|
}
|