@carbon/styles 0.11.0-rc.0 → 0.13.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/index.scss CHANGED
@@ -15,4 +15,6 @@
15
15
 
16
16
  @use 'scss/reset';
17
17
  @forward 'scss/fonts';
18
+ @forward 'scss/layer';
19
+ @forward 'scss/zone';
18
20
  @use 'scss/components';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/styles",
3
3
  "description": "Styles for the Carbon Design System",
4
- "version": "0.11.0-rc.0",
4
+ "version": "0.13.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -20,18 +20,18 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@carbon/colors": "^10.34.0",
24
- "@carbon/feature-flags": "^0.6.0",
25
- "@carbon/grid": "^10.39.0",
26
- "@carbon/layout": "^10.34.0",
27
- "@carbon/motion": "^10.26.0",
28
- "@carbon/themes": "^10.48.0-rc.0",
29
- "@carbon/type": "^10.39.0-rc.0",
23
+ "@carbon/colors": "^10.35.0",
24
+ "@carbon/feature-flags": "^0.7.0",
25
+ "@carbon/grid": "^10.40.0",
26
+ "@carbon/layout": "^10.35.0",
27
+ "@carbon/motion": "^10.27.0",
28
+ "@carbon/themes": "^10.49.0",
29
+ "@carbon/type": "^10.40.0",
30
30
  "@ibm/plex": "6.0.0-next.6"
31
31
  },
32
32
  "devDependencies": {
33
- "@carbon/test-utils": "^10.20.0",
33
+ "@carbon/test-utils": "^10.21.0",
34
34
  "css": "^3.0.0"
35
35
  },
36
- "gitHead": "f6e5dd2362aa2970add45c7fb7fc32841c252671"
36
+ "gitHead": "885c987334058efa5ba30582d615c04de2e631a4"
37
37
  }
package/scss/_config.scss CHANGED
@@ -36,6 +36,12 @@ $font-display: 'swap' !default;
36
36
  /// @group config
37
37
  $font-path: '~@ibm/plex' !default;
38
38
 
39
+ /// Specify if IBM Plex should be provided by Google Fonts
40
+ /// @access public
41
+ /// @type String
42
+ /// @group config
43
+ $use-google-fonts: false !default;
44
+
39
45
  /// The value used to prefix selectors and CSS Custom Properties across the
40
46
  /// codebase
41
47
  /// @access public
@@ -0,0 +1,112 @@
1
+ //
2
+ // Copyright IBM Corp. 2021
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:list';
9
+ @use 'sass:map';
10
+ @use './config' as *;
11
+ @use './theme';
12
+ @use './utilities/custom-property';
13
+
14
+ $-default-layer-sets: (
15
+ layer: (
16
+ theme.$layer-01,
17
+ theme.$layer-02,
18
+ theme.$layer-03,
19
+ ),
20
+ layer-active: (
21
+ theme.$layer-active-01,
22
+ theme.$layer-active-02,
23
+ theme.$layer-active-03,
24
+ ),
25
+ layer-hover: (
26
+ theme.$layer-hover-01,
27
+ theme.$layer-hover-02,
28
+ theme.$layer-hover-03,
29
+ ),
30
+ layer-selected: (
31
+ theme.$layer-selected-01,
32
+ theme.$layer-selected-02,
33
+ theme.$layer-selected-03,
34
+ ),
35
+ layer-selected-hover: (
36
+ theme.$layer-selected-hover-01,
37
+ theme.$layer-selected-hover-02,
38
+ theme.$layer-selected-hover-03,
39
+ ),
40
+ layer-accent: (
41
+ theme.$layer-accent-01,
42
+ theme.$layer-accent-02,
43
+ theme.$layer-accent-03,
44
+ ),
45
+ layer-accent-hover: (
46
+ theme.$layer-accent-hover-01,
47
+ theme.$layer-accent-hover-02,
48
+ theme.$layer-accent-hover-03,
49
+ ),
50
+ layer-accent-active: (
51
+ theme.$layer-accent-active-01,
52
+ theme.$layer-accent-active-02,
53
+ theme.$layer-accent-active-03,
54
+ ),
55
+ field: (
56
+ theme.$field-01,
57
+ theme.$field-02,
58
+ theme.$field-03,
59
+ ),
60
+ field-hover: (
61
+ theme.$field-hover-01,
62
+ theme.$field-hover-02,
63
+ theme.$field-hover-03,
64
+ ),
65
+ border-subtle: (
66
+ theme.$border-subtle-01,
67
+ theme.$border-subtle-02,
68
+ theme.$border-subtle-03,
69
+ ),
70
+ border-subtle-selected: (
71
+ theme.$border-subtle-selected-01,
72
+ theme.$border-subtle-selected-02,
73
+ theme.$border-subtle-selected-03,
74
+ ),
75
+ border-strong: (
76
+ theme.$border-strong-01,
77
+ theme.$border-strong-02,
78
+ theme.$border-strong-03,
79
+ ),
80
+ );
81
+
82
+ /// Define a map of layer sets, each set should have values for each layer in
83
+ /// the application. The key of this map is used for the CSS Custom Property
84
+ /// name whose value is updated as more layers are added.
85
+ /// @type {Map}
86
+ $layer-sets: () !default;
87
+ $layer-sets: map.deep-merge($-default-layer-sets, $layer-sets);
88
+
89
+ /// Emit the layer tokens defined in $layer-sets for the given $level
90
+ /// @param {Number} $level
91
+ @mixin -emit-layer-tokens($level) {
92
+ @each $key, $layer-set in $layer-sets {
93
+ $value: list.nth($layer-set, $level);
94
+ @include custom-property.declaration($key, $value);
95
+ }
96
+ }
97
+
98
+ :root {
99
+ @include -emit-layer-tokens(1);
100
+ }
101
+
102
+ .#{$prefix}--layer-one {
103
+ @include -emit-layer-tokens(1);
104
+ }
105
+
106
+ .#{$prefix}--layer-two {
107
+ @include -emit-layer-tokens(2);
108
+ }
109
+
110
+ .#{$prefix}--layer-three {
111
+ @include -emit-layer-tokens(3);
112
+ }
package/scss/_theme.scss CHANGED
@@ -19,75 +19,6 @@
19
19
  @forward '@carbon/themes/scss/modules/tokens';
20
20
  @use '@carbon/themes/scss/modules/tokens';
21
21
  @use './utilities/custom-property';
22
- @use './utilities/layer-set' with (
23
- $layer-sets: (
24
- layer: (
25
- tokens.$layer-01,
26
- tokens.$layer-02,
27
- tokens.$layer-03,
28
- ),
29
- layer-active: (
30
- tokens.$layer-active-01,
31
- tokens.$layer-active-02,
32
- tokens.$layer-active-03,
33
- ),
34
- layer-hover: (
35
- tokens.$layer-hover-01,
36
- tokens.$layer-hover-02,
37
- tokens.$layer-hover-03,
38
- ),
39
- layer-selected: (
40
- tokens.$layer-selected-01,
41
- tokens.$layer-selected-02,
42
- tokens.$layer-selected-03,
43
- ),
44
- layer-selected-hover: (
45
- tokens.$layer-selected-hover-01,
46
- tokens.$layer-selected-hover-02,
47
- tokens.$layer-selected-hover-03,
48
- ),
49
- layer-accent: (
50
- tokens.$layer-accent-01,
51
- tokens.$layer-accent-02,
52
- tokens.$layer-accent-03,
53
- ),
54
- layer-accent-hover: (
55
- tokens.$layer-accent-hover-01,
56
- tokens.$layer-accent-hover-02,
57
- tokens.$layer-accent-hover-03,
58
- ),
59
- layer-accent-active: (
60
- tokens.$layer-accent-active-01,
61
- tokens.$layer-accent-active-02,
62
- tokens.$layer-accent-active-03,
63
- ),
64
- field: (
65
- tokens.$field-01,
66
- tokens.$field-02,
67
- tokens.$field-03,
68
- ),
69
- field-hover: (
70
- tokens.$field-hover-01,
71
- tokens.$field-hover-02,
72
- tokens.$field-hover-03,
73
- ),
74
- border-subtle: (
75
- tokens.$border-subtle-01,
76
- tokens.$border-subtle-02,
77
- tokens.$border-subtle-03,
78
- ),
79
- border-subtle-selected: (
80
- tokens.$border-subtle-selected-01,
81
- tokens.$border-subtle-selected-02,
82
- tokens.$border-subtle-selected-03,
83
- ),
84
- border-strong: (
85
- tokens.$border-strong-01,
86
- tokens.$border-strong-02,
87
- tokens.$border-strong-03,
88
- ),
89
- ),
90
- );
91
22
 
92
23
  // Layer sets
93
24
  $layer: custom-property.get-var('layer');
package/scss/_type.scss CHANGED
@@ -12,6 +12,7 @@
12
12
  type-style,
13
13
  font-family,
14
14
  default-type,
15
+ type-classes,
15
16
 
16
17
  // Variables
17
18
  $caption-01,
package/scss/_zone.scss CHANGED
@@ -10,6 +10,8 @@
10
10
  @use './config';
11
11
  @use './themes';
12
12
  @use './theme';
13
+ // Inline themes depend on layer styles to property reset the layer level
14
+ @use './layer';
13
15
  @use './utilities/custom-property';
14
16
 
15
17
  /// Specify a Map of zones where the key will be used as part of the selector
@@ -51,6 +51,7 @@
51
51
  @use 'text-input';
52
52
  @use 'tile';
53
53
  @use 'time-picker';
54
+ @use 'toggletip';
54
55
  @use 'toggle';
55
56
  @use 'tooltip';
56
57
  @use 'treeview';
@@ -13,8 +13,11 @@
13
13
  @use '../../type' as *;
14
14
  @use '../../utilities/component-reset';
15
15
  @use '../../utilities/convert' as *;
16
+ @use '../../utilities/custom-property';
16
17
  @use 'tokens' as *;
17
18
 
19
+ $button-focus-color: custom-property.get-var('button-focus-color', $focus);
20
+
18
21
  @mixin button-base {
19
22
  @include component-reset.reset;
20
23
  @include type-style('body-short-01');
@@ -84,8 +87,8 @@
84
87
  }
85
88
 
86
89
  &:focus {
87
- border-color: $focus;
88
- box-shadow: inset 0 0 0 $button-outline-width $focus,
90
+ border-color: $button-focus-color;
91
+ box-shadow: inset 0 0 0 $button-outline-width $button-focus-color,
89
92
  inset 0 0 0 $button-border-width $background;
90
93
  }
91
94
 
@@ -330,11 +330,11 @@ $button-disabled: (
330
330
  ),
331
331
  (
332
332
  theme: themes.$g90,
333
- value: #6f6f6f,
333
+ value: rgba(141, 141, 141, 0.3),
334
334
  ),
335
335
  (
336
336
  theme: themes.$g100,
337
- value: #525252,
337
+ value: rgba(141, 141, 141, 0.3),
338
338
  ),
339
339
  ),
340
340
  ) !default;
@@ -141,8 +141,8 @@
141
141
  // vertically center icon within parent container on IE11
142
142
  top: 50%;
143
143
  right: 1rem;
144
- cursor: pointer;
145
144
  fill: $icon-primary;
145
+ pointer-events: none;
146
146
  transform: translateY(-50%);
147
147
  }
148
148
 
@@ -219,6 +219,7 @@
219
219
  text-decoration: none;
220
220
  transform: scale(1, 1) #{'/*rtl: scale(-1,1)*/'};
221
221
  transition: background-color $duration-fast-01 motion(standard, productive);
222
+ user-select: none;
222
223
  // Windows HCM fix
223
224
  @include high-contrast-mode('icon-fill');
224
225
 
@@ -11,8 +11,19 @@
11
11
  @use '../../theme' as *;
12
12
  @use '../../type';
13
13
  @use '../../utilities/component-reset';
14
+ @use '../../utilities/custom-property';
14
15
  @use '../../utilities/focus-outline' as *;
15
16
 
17
+ $link-text-color: custom-property.get-var('link-text-color', $link-primary);
18
+ $link-hover-text-color: custom-property.get-var(
19
+ 'link-hover-text-color',
20
+ $link-primary-hover
21
+ );
22
+ $link-focus-text-color: custom-property.get-var(
23
+ 'link-focus-text-color',
24
+ $focus
25
+ );
26
+
16
27
  /// Link styles
17
28
  /// @access public
18
29
  /// @group link
@@ -22,13 +33,13 @@
22
33
  @include type.type-style('body-short-01');
23
34
 
24
35
  display: inline-flex;
25
- color: $link-primary;
36
+ color: $link-text-color;
26
37
  outline: none;
27
38
  text-decoration: none;
28
39
  transition: color $duration-fast-01 motion(standard, productive);
29
40
 
30
41
  &:hover {
31
- color: $link-primary-hover;
42
+ color: $link-hover-text-color;
32
43
  text-decoration: underline;
33
44
  }
34
45
 
@@ -41,6 +52,8 @@
41
52
 
42
53
  &:focus {
43
54
  @include focus-outline;
55
+
56
+ outline-color: $link-focus-text-color;
44
57
  }
45
58
 
46
59
  &:visited {
@@ -324,5 +324,8 @@
324
324
  .#{$prefix}--inline-notification__icon {
325
325
  @include high-contrast-mode('icon-fill');
326
326
  }
327
+ .#{$prefix}--inline-notification__close-icon {
328
+ @include high-contrast-mode('icon-fill');
329
+ }
327
330
  /* stylelint-enable */
328
331
  }
@@ -255,6 +255,9 @@
255
255
  .#{$prefix}--toast-notification__close-button:focus {
256
256
  @include high-contrast-mode('focus');
257
257
  }
258
+ .#{$prefix}--toast-notification__close-icon {
259
+ @include high-contrast-mode('icon-fill');
260
+ }
258
261
  .#{$prefix}--toast-notification__icon {
259
262
  @include high-contrast-mode('icon-fill');
260
263
  }
@@ -214,6 +214,11 @@
214
214
  color: $text-primary;
215
215
  }
216
216
 
217
+ .#{$prefix}--select--inline .#{$prefix}--select-input:focus option,
218
+ .#{$prefix}--select--inline .#{$prefix}--select-input:focus optgroup {
219
+ background-color: $background;
220
+ }
221
+
217
222
  .#{$prefix}--select--inline .#{$prefix}--select-input[disabled],
218
223
  .#{$prefix}--select--inline .#{$prefix}--select-input[disabled]:hover {
219
224
  background-color: $field-disabled;