@carbon/type 10.36.0 → 10.38.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/type",
3
3
  "description": "Typography for digital and software products using the Carbon Design System",
4
- "version": "10.36.0",
4
+ "version": "10.38.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -38,11 +38,11 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@carbon/import-once": "^10.6.0",
41
- "@carbon/layout": "^10.32.0"
41
+ "@carbon/layout": "^10.34.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@carbon/cli": "^10.29.0",
45
- "@carbon/test-utils": "^10.19.0",
44
+ "@carbon/cli": "^10.31.0",
45
+ "@carbon/test-utils": "^10.20.0",
46
46
  "change-case": "^4.1.1",
47
47
  "rimraf": "^3.0.0"
48
48
  },
@@ -52,5 +52,5 @@
52
52
  "sassDir": "scss",
53
53
  "needs": "^1.3.0"
54
54
  },
55
- "gitHead": "3dd237d343adc0b378d12e933bd99b8beca7b250"
55
+ "gitHead": "f6352a1010117000ce4ca9f71315b67b1ec8e396"
56
56
  }
@@ -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
- @return math.div($value, $value * 0 + 1);
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,7 +19,7 @@
19
19
  // compatibility file to ensure we continue to support node-sass and dart-sass
20
20
  // in v10.
21
21
 
22
- /* stylelint-disable number-max-precision */
22
+ // stylelint-disable number-max-precision
23
23
 
24
24
  @import '../vendor/@carbon/layout/breakpoint';
25
25
  @import 'font-family';
@@ -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 '@carbon/layout/scss/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
- @return math.div($value, $value * 0 + 1);
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
package/scss/_styles.scss CHANGED
@@ -19,7 +19,7 @@
19
19
  // compatibility file to ensure we continue to support node-sass and dart-sass
20
20
  // in v10.
21
21
 
22
- /* stylelint-disable number-max-precision */
22
+ // stylelint-disable number-max-precision
23
23
 
24
24
  @import '@carbon/layout/scss/breakpoint';
25
25
  @import 'font-family';
@@ -5,7 +5,7 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- /* stylelint-disable number-max-precision */
8
+ // stylelint-disable number-max-precision
9
9
 
10
10
  @use 'sass:map';
11
11
  @use '@carbon/layout';
@@ -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
- @return math.div($px, $carbon--base-font-size) * 1rem;
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
- @return math.div($px, $carbon--base-font-size) * 1em;
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
- @return math.div($width - (2 * $margin), $columns);
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
- @return math.div($px, $base-font-size) * 1rem;
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
- @return math.div($px, $base-font-size) * 1em;
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
  }