@carbon/elements 10.44.0-rc.0 → 10.46.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 +10 -10
- package/scss/grid/_inlined/_mixins.import.scss +38 -23
- package/scss/grid/_mixins.import.scss +38 -23
- package/scss/grid/modules/_css-grid.scss +8 -11
- package/scss/grid/modules/_mixins.scss +14 -3
- package/scss/grid/vendor/@carbon/layout/_convert.import.scss +11 -2
- package/scss/grid/vendor/@carbon/layout/_key-height.import.scss +6 -1
- package/scss/grid/vendor/@carbon/layout/modules/_convert.scss +11 -2
- package/scss/layout/_convert.import.scss +11 -2
- package/scss/layout/_key-height.import.scss +6 -1
- package/scss/layout/modules/_convert.scss +11 -2
- package/scss/themes/compat/generated/_themes.scss +2 -2
- package/scss/themes/generated/_mixins.scss +9 -0
- package/scss/themes/generated/_themes.scss +16 -6
- package/scss/themes/generated/_tokens.scss +10 -0
- package/scss/themes/modules/generated/_themes.scss +6 -2
- package/scss/themes/modules/generated/_tokens.scss +3 -0
- package/scss/type/_inlined/_styles.import.scss +6 -1
- package/scss/type/_styles.import.scss +6 -1
- package/scss/type/vendor/@carbon/layout/_convert.import.scss +11 -2
- package/scss/type/vendor/@carbon/layout/_key-height.import.scss +6 -1
- package/scss/type/vendor/@carbon/layout/modules/_convert.scss +11 -2
- package/src/__tests__/__snapshots__/PublicAPI-test.js.snap +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/elements",
|
|
3
3
|
"description": "A collection of design elements in code for the IBM Design Language",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.46.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
"clean": "rimraf es lib umd && node tasks/clean.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@carbon/colors": "^10.
|
|
39
|
-
"@carbon/grid": "^10.
|
|
40
|
-
"@carbon/icons": "^10.
|
|
38
|
+
"@carbon/colors": "^10.33.0",
|
|
39
|
+
"@carbon/grid": "^10.39.0-rc.0",
|
|
40
|
+
"@carbon/icons": "^10.41.0",
|
|
41
41
|
"@carbon/import-once": "^10.6.0",
|
|
42
|
-
"@carbon/layout": "^10.
|
|
43
|
-
"@carbon/motion": "^10.
|
|
44
|
-
"@carbon/themes": "^10.
|
|
45
|
-
"@carbon/type": "^10.
|
|
42
|
+
"@carbon/layout": "^10.34.0-rc.0",
|
|
43
|
+
"@carbon/motion": "^10.25.0",
|
|
44
|
+
"@carbon/themes": "^10.46.0-rc.0",
|
|
45
|
+
"@carbon/type": "^10.38.0-rc.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@carbon/cli": "^10.
|
|
48
|
+
"@carbon/cli": "^10.30.0",
|
|
49
49
|
"fs-extra": "^8.1.0",
|
|
50
50
|
"klaw-sync": "^6.0.0",
|
|
51
51
|
"replace-in-file": "^3.4.2",
|
|
52
52
|
"rimraf": "^3.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "b5f01ac2dbf9e5acb901cfc939b4ddd4d951a35e"
|
|
55
55
|
}
|
|
@@ -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);
|
|
@@ -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 '../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);
|
|
@@ -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';
|
|
@@ -254,10 +255,6 @@
|
|
|
254
255
|
.#{$prefix}--col-start-#{$i} {
|
|
255
256
|
grid-column-start: $i;
|
|
256
257
|
}
|
|
257
|
-
|
|
258
|
-
.#{$prefix}--col-end-#{$i} {
|
|
259
|
-
grid-column-end: $i;
|
|
260
|
-
}
|
|
261
258
|
}
|
|
262
259
|
|
|
263
260
|
.#{$prefix}--col-start-auto {
|
|
@@ -272,17 +269,13 @@
|
|
|
272
269
|
$columns: map.get($value, columns);
|
|
273
270
|
|
|
274
271
|
@include breakpoint($name) {
|
|
275
|
-
// The `grid-column-
|
|
276
|
-
// It starts
|
|
272
|
+
// The `grid-column-start` property is *not* inclusive.
|
|
273
|
+
// It starts the column *at* the column, not *on* the column. We must
|
|
277
274
|
// ensure that there is one additional class available for each breakpoint.
|
|
278
275
|
@for $i from 1 through $columns + 1 {
|
|
279
276
|
.#{$prefix}--#{$name}\:col-start-#{$i} {
|
|
280
277
|
grid-column-start: $i;
|
|
281
278
|
}
|
|
282
|
-
|
|
283
|
-
.#{$prefix}--#{$name}\:col-end-#{$i} {
|
|
284
|
-
grid-column-end: $i;
|
|
285
|
-
}
|
|
286
279
|
}
|
|
287
280
|
|
|
288
281
|
.#{$prefix}--#{$name}\:col-start-auto {
|
|
@@ -413,7 +406,11 @@ $carbon--aspect-ratios: (
|
|
|
413
406
|
$height: nth($aspect-ratio, 2);
|
|
414
407
|
|
|
415
408
|
.#{$prefix}--aspect-ratio--#{$width}x#{$height}::before {
|
|
416
|
-
|
|
409
|
+
@if meta.function-exists('div', 'math') {
|
|
410
|
+
padding-top: percentage(math.div($height, $width));
|
|
411
|
+
} @else {
|
|
412
|
+
padding-top: percentage(($height / $width));
|
|
413
|
+
}
|
|
417
414
|
}
|
|
418
415
|
}
|
|
419
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
|
}
|
|
@@ -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
|
}
|
|
@@ -171,7 +171,7 @@ $g90: (
|
|
|
171
171
|
inverse-support-02: #24a148,
|
|
172
172
|
inverse-support-03: #f1c21b,
|
|
173
173
|
inverse-support-04: #0f62fe,
|
|
174
|
-
overlay-01: rgba(
|
|
174
|
+
overlay-01: rgba(0, 0, 0, 0.65),
|
|
175
175
|
danger-01: #da1e28,
|
|
176
176
|
danger-02: #ff8389,
|
|
177
177
|
inverse-focus-ui: #0f62fe,
|
|
@@ -237,7 +237,7 @@ $g100: (
|
|
|
237
237
|
inverse-support-02: #24a148,
|
|
238
238
|
inverse-support-03: #f1c21b,
|
|
239
239
|
inverse-support-04: #0f62fe,
|
|
240
|
-
overlay-01: rgba(
|
|
240
|
+
overlay-01: rgba(0, 0, 0, 0.65),
|
|
241
241
|
danger-01: #da1e28,
|
|
242
242
|
danger-02: #fa4d56,
|
|
243
243
|
inverse-focus-ui: #0f62fe,
|
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
$support-info-inverse: map-get($theme, 'support-info-inverse') !global;
|
|
142
142
|
$overlay: map-get($theme, 'overlay') !global;
|
|
143
143
|
$toggle-off: map-get($theme, 'toggle-off') !global;
|
|
144
|
+
$shadow: map-get($theme, 'shadow') !global;
|
|
144
145
|
$button-primary: map-get($theme, 'button-primary') !global;
|
|
145
146
|
$button-secondary: map-get($theme, 'button-secondary') !global;
|
|
146
147
|
$button-tertiary: map-get($theme, 'button-tertiary') !global;
|
|
@@ -784,6 +785,10 @@
|
|
|
784
785
|
--#{$custom-property-prefix}-toggle-off,
|
|
785
786
|
map-get($theme, 'toggle-off')
|
|
786
787
|
) !global;
|
|
788
|
+
$shadow: var(
|
|
789
|
+
--#{$custom-property-prefix}-shadow,
|
|
790
|
+
map-get($theme, 'shadow')
|
|
791
|
+
) !global;
|
|
787
792
|
$button-primary: var(
|
|
788
793
|
--#{$custom-property-prefix}-button-primary,
|
|
789
794
|
map-get($theme, 'button-primary')
|
|
@@ -2128,6 +2133,10 @@
|
|
|
2128
2133
|
@include custom-property('toggle-off', map-get($theme, 'toggle-off'));
|
|
2129
2134
|
}
|
|
2130
2135
|
|
|
2136
|
+
@if should-emit($theme, $parent-carbon-theme, 'shadow', $emit-difference) {
|
|
2137
|
+
@include custom-property('shadow', map-get($theme, 'shadow'));
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2131
2140
|
@if should-emit(
|
|
2132
2141
|
$theme,
|
|
2133
2142
|
$parent-carbon-theme,
|
|
@@ -110,6 +110,7 @@ $carbon--theme--white: (
|
|
|
110
110
|
support-info-inverse: #4589ff,
|
|
111
111
|
overlay: rgba(22, 22, 22, 0.5),
|
|
112
112
|
toggle-off: #8d8d8d,
|
|
113
|
+
shadow: rgba(0, 0, 0, 0.3),
|
|
113
114
|
button-primary: #0f62fe,
|
|
114
115
|
button-secondary: #393939,
|
|
115
116
|
button-tertiary: #0f62fe,
|
|
@@ -1000,7 +1001,8 @@ $carbon--theme--g80: map-merge(
|
|
|
1000
1001
|
support-error-inverse: #da1e28,
|
|
1001
1002
|
support-success-inverse: #24a148,
|
|
1002
1003
|
support-info-inverse: #0f62fe,
|
|
1003
|
-
overlay: rgba(
|
|
1004
|
+
overlay: rgba(0, 0, 0, 0.65),
|
|
1005
|
+
shadow: rgba(0, 0, 0, 0.8),
|
|
1004
1006
|
button-secondary: #6f6f6f,
|
|
1005
1007
|
button-tertiary: #ffffff,
|
|
1006
1008
|
button-danger-secondary: #ff8389,
|
|
@@ -1066,7 +1068,7 @@ $carbon--theme--g80: map-merge(
|
|
|
1066
1068
|
inverse-support-01: #da1e28,
|
|
1067
1069
|
inverse-support-02: #24a148,
|
|
1068
1070
|
inverse-support-04: #0f62fe,
|
|
1069
|
-
overlay-01: rgba(
|
|
1071
|
+
overlay-01: rgba(0, 0, 0, 0.65),
|
|
1070
1072
|
danger-02: #ff8389,
|
|
1071
1073
|
inverse-focus-ui: #0f62fe,
|
|
1072
1074
|
hover-primary: #0151e4,
|
|
@@ -1133,7 +1135,7 @@ $carbon--theme--g90: map-merge(
|
|
|
1133
1135
|
inverse-support-01: #da1e28,
|
|
1134
1136
|
inverse-support-02: #24a148,
|
|
1135
1137
|
inverse-support-04: #0f62fe,
|
|
1136
|
-
overlay-01: rgba(
|
|
1138
|
+
overlay-01: rgba(0, 0, 0, 0.65),
|
|
1137
1139
|
danger-02: #ff8389,
|
|
1138
1140
|
focus: #ffffff,
|
|
1139
1141
|
inverse-focus-ui: #0f62fe,
|
|
@@ -1189,7 +1191,8 @@ $carbon--theme--g90: map-merge(
|
|
|
1189
1191
|
support-error-inverse: #da1e28,
|
|
1190
1192
|
support-success-inverse: #24a148,
|
|
1191
1193
|
support-info-inverse: #0f62fe,
|
|
1192
|
-
overlay: rgba(
|
|
1194
|
+
overlay: rgba(0, 0, 0, 0.65),
|
|
1195
|
+
shadow: rgba(0, 0, 0, 0.8),
|
|
1193
1196
|
button-secondary: #6f6f6f,
|
|
1194
1197
|
button-tertiary: #ffffff,
|
|
1195
1198
|
button-danger-secondary: #ff8389,
|
|
@@ -1266,7 +1269,7 @@ $carbon--theme--g100: map-merge(
|
|
|
1266
1269
|
inverse-support-01: #da1e28,
|
|
1267
1270
|
inverse-support-02: #24a148,
|
|
1268
1271
|
inverse-support-04: #0f62fe,
|
|
1269
|
-
overlay-01: rgba(
|
|
1272
|
+
overlay-01: rgba(0, 0, 0, 0.65),
|
|
1270
1273
|
danger-02: #fa4d56,
|
|
1271
1274
|
focus: #ffffff,
|
|
1272
1275
|
inverse-focus-ui: #0f62fe,
|
|
@@ -1322,8 +1325,9 @@ $carbon--theme--g100: map-merge(
|
|
|
1322
1325
|
support-error-inverse: #da1e28,
|
|
1323
1326
|
support-success-inverse: #24a148,
|
|
1324
1327
|
support-info-inverse: #0f62fe,
|
|
1325
|
-
overlay: rgba(
|
|
1328
|
+
overlay: rgba(0, 0, 0, 0.65),
|
|
1326
1329
|
toggle-off: #6f6f6f,
|
|
1330
|
+
shadow: rgba(0, 0, 0, 0.8),
|
|
1327
1331
|
button-secondary: #6f6f6f,
|
|
1328
1332
|
button-tertiary: #ffffff,
|
|
1329
1333
|
button-danger-secondary: #fa4d56,
|
|
@@ -2126,6 +2130,12 @@ $carbon--theme: (
|
|
|
2126
2130
|
$toggle-off,
|
|
2127
2131
|
map-get($carbon--theme--white, 'toggle-off')
|
|
2128
2132
|
),
|
|
2133
|
+
shadow:
|
|
2134
|
+
if(
|
|
2135
|
+
global-variable-exists('shadow'),
|
|
2136
|
+
$shadow,
|
|
2137
|
+
map-get($carbon--theme--white, 'shadow')
|
|
2138
|
+
),
|
|
2129
2139
|
button-primary:
|
|
2130
2140
|
if(
|
|
2131
2141
|
global-variable-exists('button-primary'),
|
|
@@ -1090,6 +1090,16 @@ $toggle-off: if(
|
|
|
1090
1090
|
#8d8d8d
|
|
1091
1091
|
) !default;
|
|
1092
1092
|
|
|
1093
|
+
/// @type {undefined}
|
|
1094
|
+
/// @access public
|
|
1095
|
+
/// @group @carbon/themes
|
|
1096
|
+
$shadow: if(
|
|
1097
|
+
global-variable-exists('carbon--theme') and
|
|
1098
|
+
map-has-key($carbon--theme, 'shadow'),
|
|
1099
|
+
map-get($carbon--theme, 'shadow'),
|
|
1100
|
+
rgba(0, 0, 0, 0.3)
|
|
1101
|
+
) !default;
|
|
1102
|
+
|
|
1093
1103
|
/// @type {undefined}
|
|
1094
1104
|
/// @access public
|
|
1095
1105
|
/// @group @carbon/themes
|
|
@@ -107,6 +107,7 @@ $white: (
|
|
|
107
107
|
highlight: #d0e2ff,
|
|
108
108
|
overlay: rgba(22, 22, 22, 0.5),
|
|
109
109
|
toggle-off: #8d8d8d,
|
|
110
|
+
shadow: rgba(0, 0, 0, 0.3),
|
|
110
111
|
) !default;
|
|
111
112
|
$white: utilities.merge(
|
|
112
113
|
$white,
|
|
@@ -211,6 +212,7 @@ $g10: (
|
|
|
211
212
|
highlight: #d0e2ff,
|
|
212
213
|
overlay: rgba(22, 22, 22, 0.5),
|
|
213
214
|
toggle-off: #8d8d8d,
|
|
215
|
+
shadow: rgba(0, 0, 0, 0.3),
|
|
214
216
|
) !default;
|
|
215
217
|
$g10: utilities.merge(
|
|
216
218
|
$g10,
|
|
@@ -313,8 +315,9 @@ $g90: (
|
|
|
313
315
|
skeleton-element: #525252,
|
|
314
316
|
interactive: #4589ff,
|
|
315
317
|
highlight: #0043ce,
|
|
316
|
-
overlay: rgba(
|
|
318
|
+
overlay: rgba(0, 0, 0, 0.65),
|
|
317
319
|
toggle-off: #8d8d8d,
|
|
320
|
+
shadow: rgba(0, 0, 0, 0.8),
|
|
318
321
|
) !default;
|
|
319
322
|
$g90: utilities.merge(
|
|
320
323
|
$g90,
|
|
@@ -417,8 +420,9 @@ $g100: (
|
|
|
417
420
|
skeleton-element: #393939,
|
|
418
421
|
interactive: #4589ff,
|
|
419
422
|
highlight: #d0e2ff,
|
|
420
|
-
overlay: rgba(
|
|
423
|
+
overlay: rgba(0, 0, 0, 0.65),
|
|
421
424
|
toggle-off: #8d8d8d,
|
|
425
|
+
shadow: rgba(0, 0, 0, 0.8),
|
|
422
426
|
) !default;
|
|
423
427
|
$g100: utilities.merge(
|
|
424
428
|
$g100,
|
|
@@ -289,6 +289,9 @@ $overlay: _get('overlay') !default;
|
|
|
289
289
|
/// The CSS Custom Property for the `toggle-off` token
|
|
290
290
|
$toggle-off: _get('toggle-off') !default;
|
|
291
291
|
|
|
292
|
+
/// The CSS Custom Property for the `shadow` token
|
|
293
|
+
$shadow: _get('shadow') !default;
|
|
294
|
+
|
|
292
295
|
/// The CSS Custom Property for the `focus` token
|
|
293
296
|
$focus: _get('focus') !default;
|
|
294
297
|
|
|
@@ -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 '../vendor/@carbon/layout/breakpoint'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
24
25
|
@import 'font-family'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
@@ -582,7 +583,11 @@ $tokens: (
|
|
|
582
583
|
/// @access public
|
|
583
584
|
/// @group @carbon/type
|
|
584
585
|
@function strip-unit($value) {
|
|
585
|
-
@
|
|
586
|
+
@if meta.function-exists('div', 'math') {
|
|
587
|
+
@return math.div($value, $value * 0 + 1);
|
|
588
|
+
} @else {
|
|
589
|
+
@return $value / ($value * 0 + 1);
|
|
590
|
+
}
|
|
586
591
|
}
|
|
587
592
|
|
|
588
593
|
/// This helper includes fluid type styles for the given token value. Fluid type
|
|
@@ -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 '../layout/breakpoint'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
24
25
|
@import 'font-family'; /* stylelint-disable-line no-invalid-position-at-import-rule */
|
|
@@ -582,7 +583,11 @@ $tokens: (
|
|
|
582
583
|
/// @access public
|
|
583
584
|
/// @group @carbon/type
|
|
584
585
|
@function strip-unit($value) {
|
|
585
|
-
@
|
|
586
|
+
@if meta.function-exists('div', 'math') {
|
|
587
|
+
@return math.div($value, $value * 0 + 1);
|
|
588
|
+
} @else {
|
|
589
|
+
@return $value / ($value * 0 + 1);
|
|
590
|
+
}
|
|
586
591
|
}
|
|
587
592
|
|
|
588
593
|
/// This helper includes fluid type styles for the given token value. Fluid type
|
|
@@ -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
|
}
|