@carbon/type 11.0.0 → 11.2.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.
Files changed (33) hide show
  1. package/README.md +1 -1
  2. package/index.scss +3 -5
  3. package/package.json +6 -6
  4. package/scss/_default-type.scss +7 -7
  5. package/scss/_prefix.scss +18 -1
  6. package/scss/_styles.scss +1 -4
  7. package/scss/_inlined/_classes.scss +0 -42
  8. package/scss/_inlined/_default-type.scss +0 -49
  9. package/scss/_inlined/_font-family.scss +0 -104
  10. package/scss/_inlined/_prefix.scss +0 -11
  11. package/scss/_inlined/_reset.scss +0 -42
  12. package/scss/_inlined/_scale.scss +0 -57
  13. package/scss/_inlined/_styles.scss +0 -856
  14. package/scss/vendor/@carbon/grid/_breakpoint.scss +0 -198
  15. package/scss/vendor/@carbon/grid/_config.scss +0 -94
  16. package/scss/vendor/@carbon/grid/_css-grid.scss +0 -470
  17. package/scss/vendor/@carbon/grid/_flex-grid.scss +0 -343
  18. package/scss/vendor/@carbon/grid/_inlined/_breakpoint.scss +0 -198
  19. package/scss/vendor/@carbon/grid/_inlined/_config.scss +0 -94
  20. package/scss/vendor/@carbon/grid/_inlined/_css-grid.scss +0 -470
  21. package/scss/vendor/@carbon/grid/_inlined/_flex-grid.scss +0 -343
  22. package/scss/vendor/@carbon/grid/_inlined/_mixins.scss +0 -316
  23. package/scss/vendor/@carbon/grid/_mixins.scss +0 -316
  24. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_convert.import.scss +0 -63
  25. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_convert.scss +0 -49
  26. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_spacing.scss +0 -9
  27. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_utilities.scss +0 -41
  28. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_container.scss +0 -43
  29. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_fluid-spacing.scss +0 -37
  30. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_icon-size.scss +0 -25
  31. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_size.scss +0 -17
  32. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_spacing.scss +0 -91
  33. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/_convert.scss +0 -49
package/README.md CHANGED
@@ -85,7 +85,7 @@ what we call type styles. These tokens have a variety of properties for styling
85
85
  how text is rendered on a page.
86
86
 
87
87
  You can find a full reference of the type styles that are available on the
88
- [Carbon Design System website](https://www.carbondesignsystem.com/guidelines/typography/productive)
88
+ [Carbon Design System website](https://www.carbondesignsystem.com/guidelines/typography/type-sets)
89
89
  .
90
90
 
91
91
  You can include a token in your Sass file by writing:
package/index.scss CHANGED
@@ -5,12 +5,10 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @forward 'scss/prefix' with (
9
- $prefix: 'bx' !default,
10
- );
11
- @forward 'scss/classes';
8
+ @forward 'scss/prefix';
12
9
  @forward 'scss/font-family';
13
- @forward 'scss/reset';
14
10
  @forward 'scss/scale';
11
+ @forward 'scss/reset';
15
12
  @forward 'scss/styles';
13
+ @forward 'scss/classes';
16
14
  @forward 'scss/default-type';
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": "11.0.0",
4
+ "version": "11.2.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -33,15 +33,15 @@
33
33
  "access": "public"
34
34
  },
35
35
  "scripts": {
36
- "build": "yarn clean && carbon-cli bundle src/index.js --name CarbonType && carbon-cli inline && carbon-cli check \"scss/*.scss\"",
37
- "clean": "rimraf css es lib umd scss/_inlined scss/vendor"
36
+ "build": "yarn clean && carbon-cli bundle src/index.js --name CarbonType && carbon-cli check \"scss/*.scss\"",
37
+ "clean": "rimraf css es lib umd"
38
38
  },
39
39
  "dependencies": {
40
- "@carbon/grid": "^11.0.0"
40
+ "@carbon/grid": "^11.1.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@carbon/cli": "^11.0.0",
44
- "@carbon/test-utils": "^10.22.0",
44
+ "@carbon/test-utils": "^10.23.0",
45
45
  "change-case": "^4.1.1",
46
46
  "css": "^3.0.0",
47
47
  "rimraf": "^3.0.0"
@@ -52,5 +52,5 @@
52
52
  "sassDir": "scss",
53
53
  "needs": "^1.3.0"
54
54
  },
55
- "gitHead": "c88ac3391e9583e6e10e2de2c509b006f0d60cac"
55
+ "gitHead": "b429fb727138d42e93696ff4f8ab70d174dd7ac8"
56
56
  }
@@ -12,31 +12,31 @@
12
12
  /// @group @carbon/type
13
13
  @mixin default-type {
14
14
  h1 {
15
- @include type-style('productive-heading-06');
15
+ @include type-style('heading-06');
16
16
  }
17
17
 
18
18
  h2 {
19
- @include type-style('productive-heading-05');
19
+ @include type-style('heading-05');
20
20
  }
21
21
 
22
22
  h3 {
23
- @include type-style('productive-heading-04');
23
+ @include type-style('heading-04');
24
24
  }
25
25
 
26
26
  h4 {
27
- @include type-style('productive-heading-03');
27
+ @include type-style('heading-03');
28
28
  }
29
29
 
30
30
  h5 {
31
- @include type-style('productive-heading-02');
31
+ @include type-style('heading-02');
32
32
  }
33
33
 
34
34
  h6 {
35
- @include type-style('productive-heading-01');
35
+ @include type-style('heading-01');
36
36
  }
37
37
 
38
38
  p {
39
- @include type-style('body-long-02');
39
+ @include type-style('body-02');
40
40
  }
41
41
 
42
42
  a {
package/scss/_prefix.scss CHANGED
@@ -5,7 +5,24 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
+ @use 'sass:map';
9
+
8
10
  /// @type String
9
11
  /// @access public
10
12
  /// @group @carbon/type
11
- $prefix: 'bx' !default;
13
+ $prefix: 'cds' !default;
14
+
15
+ /// @type String
16
+ /// @access public
17
+ /// @group @carbon/type
18
+ $custom-property-prefix: 'cds' !default;
19
+
20
+ @mixin configure($values) {
21
+ @if map.has-key($values, 'prefix') {
22
+ $prefix: map.get($values, 'prefix') !global;
23
+ }
24
+
25
+ @if map.has-key($values, 'custom-property-prefix') {
26
+ $custom-property-prefix: map.get($values, 'custom-property-prefix') !global;
27
+ }
28
+ }
package/scss/_styles.scss CHANGED
@@ -11,6 +11,7 @@
11
11
  @use 'sass:math';
12
12
  @use '@carbon/grid/scss/config' as gridconfig;
13
13
  @use '@carbon/grid/scss/breakpoint' as grid;
14
+ @use 'prefix' as *;
14
15
  @use 'font-family';
15
16
  @use 'scale';
16
17
 
@@ -810,10 +811,6 @@ $tokens: (
810
811
  // TODO move following variable and `custom-property` mixin into shared file for
811
812
  // both `@carbon/type` and `@carbon/themes`
812
813
 
813
- /// @access private
814
- /// @group @carbon/type
815
- $custom-property-prefix: 'cds' !default;
816
-
817
814
  /// @access private
818
815
  /// @group @carbon/type
819
816
  @mixin custom-properties($name, $value) {
@@ -1,42 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2018, 2018
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
-
8
- @use 'sass:map';
9
- @use 'font-family' as *;
10
- @use 'prefix' as *;
11
- @use 'styles' as *;
12
-
13
- /// Create type classes for font families, weights, styles
14
- /// @access public
15
- /// @group @carbon/type
16
- @mixin type-classes {
17
- // Font families
18
- @each $name, $value in $font-families {
19
- .#{$prefix}--type-#{$name} {
20
- font-family: $value;
21
- }
22
- }
23
-
24
- // Font weights
25
- @each $name, $value in $font-weights {
26
- .#{$prefix}--type-#{$name} {
27
- font-weight: $value;
28
- }
29
- }
30
-
31
- // Font styles
32
- .#{$prefix}--type-italic {
33
- font-style: italic;
34
- }
35
-
36
- // Type styles
37
- @each $name, $value in $tokens {
38
- .#{$prefix}--type-#{$name} {
39
- @include type-style($name, map.has-key($value, breakpoints));
40
- }
41
- }
42
- }
@@ -1,49 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2018, 2018
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
- @use 'sass:meta';
8
- @use 'styles' as *;
9
-
10
- /// Include default type styles
11
- /// @access public
12
- /// @group @carbon/type
13
- @mixin default-type {
14
- h1 {
15
- @include type-style('productive-heading-06');
16
- }
17
-
18
- h2 {
19
- @include type-style('productive-heading-05');
20
- }
21
-
22
- h3 {
23
- @include type-style('productive-heading-04');
24
- }
25
-
26
- h4 {
27
- @include type-style('productive-heading-03');
28
- }
29
-
30
- h5 {
31
- @include type-style('productive-heading-02');
32
- }
33
-
34
- h6 {
35
- @include type-style('productive-heading-01');
36
- }
37
-
38
- p {
39
- @include type-style('body-long-02');
40
- }
41
-
42
- a {
43
- color: var(--cds-link-primary, #0062fe);
44
- }
45
-
46
- em {
47
- font-style: italic;
48
- }
49
- }
@@ -1,104 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2018, 2018
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
-
8
- @use 'sass:string';
9
-
10
- /// Font family fallbacks for: IBM Plex Mono, IBM Plex Sans, IBM Plex Sans
11
- /// Condensed, IBM Plex Sans Hebrew, and IBM Plex Serif
12
- /// @type Map
13
- /// @access public
14
- /// @group @carbon/type
15
- $font-families: (
16
- 'mono':
17
- string.unquote(
18
- "'IBM Plex Mono', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', monospace"
19
- ),
20
- 'sans':
21
- string.unquote(
22
- "'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
23
- ),
24
- 'sans-condensed':
25
- string.unquote(
26
- "'IBM Plex Sans Condensed', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
27
- ),
28
- 'sans-arabic':
29
- string.unquote(
30
- "'IBM Plex Sans Arabic', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
31
- ),
32
- 'sans-devanagari':
33
- string.unquote(
34
- "'IBM Plex Sans Devanagari', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
35
- ),
36
- 'sans-hebrew':
37
- string.unquote(
38
- "'IBM Plex Sans Hebrew', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
39
- ),
40
- 'sans-jp':
41
- string.unquote(
42
- "'IBM Plex Sans JP', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
43
- ),
44
- 'sans-kr':
45
- string.unquote(
46
- "'IBM Plex Sans KR', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
47
- ),
48
- 'sans-thai-looped':
49
- string.unquote(
50
- "'IBM Plex Sans Thai Looped', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
51
- ),
52
- 'sans-thai':
53
- string.unquote(
54
- "'IBM Plex Sans Thai', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"
55
- ),
56
- 'serif':
57
- string.unquote(
58
- "'IBM Plex Serif', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', serif"
59
- ),
60
- ) !default;
61
-
62
- /// Get the font-family for an IBM Plex font
63
- /// @param {String} $name
64
- /// @return {String}
65
- /// @access public
66
- /// @group @carbon/type
67
- @function font-family($name) {
68
- @return map-get($font-families, $name);
69
- }
70
-
71
- /// Include the `font-family` definition for the given name in your selector
72
- /// @param {String} $name
73
- /// @access public
74
- /// @group @carbon/type
75
- @mixin font-family($name) {
76
- font-family: font-family($name);
77
- }
78
-
79
- /// Suggested font weights to be used in product
80
- /// @type Map
81
- /// @access public
82
- /// @group @carbon/type
83
- $font-weights: (
84
- 'light': 300,
85
- 'regular': 400,
86
- 'semibold': 600,
87
- ) !default;
88
-
89
- /// Retrieve the font-weight value for a given name
90
- /// @param {String} $weight
91
- /// @return {Number}
92
- /// @access public
93
- /// @group @carbon/type
94
- @function font-weight($weight) {
95
- @return map-get($font-weights, $weight);
96
- }
97
-
98
- /// Set the `font-weight` property with the value for a given name
99
- /// @param {String} $weight
100
- /// @access public
101
- /// @group @carbon/type
102
- @mixin font-weight($weight) {
103
- font-weight: font-weight($weight);
104
- }
@@ -1,11 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2018, 2018
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
-
8
- /// @type String
9
- /// @access public
10
- /// @group @carbon/type
11
- $prefix: 'bx' !default;
@@ -1,42 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2018, 2018
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
-
8
- @use 'sass:map';
9
- @use 'sass:meta';
10
- @use '@carbon/layout';
11
- @use 'font-family' as *;
12
-
13
- /// Include a type reset for a given body and mono font family
14
- /// @param {String} $body-font-family [font-family('sans')] - The font family used on the `<body>` element
15
- /// @param {String} $mono-font-family [font-family('mono')] - The font family used on elements that require mono fonts, like the `<code>` element
16
- /// @access public
17
- /// @group @carbon/type
18
- @mixin reset(
19
- $body-font-family: font-family('sans'),
20
- $mono-font-family: font-family('mono')
21
- ) {
22
- html {
23
- font-size: 100%;
24
- }
25
-
26
- body {
27
- @include font-weight('regular');
28
-
29
- font-family: $body-font-family;
30
- -moz-osx-font-smoothing: grayscale;
31
- -webkit-font-smoothing: antialiased;
32
- text-rendering: optimizeLegibility;
33
- }
34
-
35
- code {
36
- font-family: $mono-font-family;
37
- }
38
-
39
- strong {
40
- @include font-weight('semibold');
41
- }
42
- }
@@ -1,57 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2018, 2018
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
-
8
- @use '@carbon/layout';
9
- @use 'sass:list';
10
-
11
- /// Compute the type size for the given type scale step
12
- /// @param {Number} $step
13
- /// @return {Number} In px
14
- /// @access public
15
- /// @group @carbon/type
16
- @function get-type-size($step) {
17
- @if $step == 1 {
18
- @return 12px;
19
- }
20
- // Yn = Yn-1 + {INT[(n-2)/4] + 1} * 2
21
- @return get-type-size($step - 1) + (floor(($step - 2) * 0.25) + 1) * 2;
22
- }
23
-
24
- /// Type scale follows a custom formula for determining each step size and supports sizes from 12px to 92px
25
- /// @type Map
26
- /// @access public
27
- /// @group @carbon/type
28
- $type-scale: ();
29
- @for $i from 1 through 23 {
30
- $type-scale: list.append($type-scale, layout.rem(get-type-size($i)));
31
- }
32
-
33
- /// Get the value of a specific step in the type scale
34
- /// @param {Number} $step
35
- /// @return {Number} In rem
36
- /// @access public
37
- /// @group @carbon/type
38
- @function type-scale($step) {
39
- @return nth($type-scale, $step);
40
- }
41
-
42
- /// Set the font-size value of a selector with the value at the given `$step`
43
- /// @param {Number} $step
44
- /// @access public
45
- /// @group @carbon/type
46
- @mixin type-scale($step) {
47
- font-size: type-scale($step);
48
- }
49
-
50
- /// Alias of `type-scale` mixin.
51
- /// @param {Number} $step
52
- /// @alias type-scale
53
- /// @access public
54
- /// @group @carbon/type
55
- @mixin font-size($step) {
56
- font-size: type-scale($step);
57
- }