@carbon/styles 1.0.2 → 1.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.
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": "1.0.
|
|
4
|
+
"version": "1.2.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
"sass": "^1.33.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@carbon/colors": "^11.
|
|
30
|
+
"@carbon/colors": "^11.1.0",
|
|
31
31
|
"@carbon/feature-flags": "^0.7.0",
|
|
32
|
-
"@carbon/grid": "^11.
|
|
33
|
-
"@carbon/layout": "^11.
|
|
32
|
+
"@carbon/grid": "^11.1.0",
|
|
33
|
+
"@carbon/layout": "^11.1.0",
|
|
34
34
|
"@carbon/motion": "^11.0.0",
|
|
35
|
-
"@carbon/themes": "^11.0.
|
|
36
|
-
"@carbon/type": "^11.0.0",
|
|
35
|
+
"@carbon/themes": "^11.2.0-rc.0",
|
|
36
|
+
"@carbon/type": "^11.2.0-rc.0",
|
|
37
37
|
"@ibm/plex": "6.0.0-next.6"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@carbon/test-utils": "^10.
|
|
40
|
+
"@carbon/test-utils": "^10.23.0",
|
|
41
41
|
"css": "^3.0.0",
|
|
42
42
|
"sass": "^1.45.0"
|
|
43
43
|
},
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"scss/**/*.scss",
|
|
47
47
|
"scss/**/*.css"
|
|
48
48
|
],
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "b429fb727138d42e93696ff4f8ab70d174dd7ac8"
|
|
50
50
|
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
+
const css = require('css');
|
|
13
14
|
|
|
14
15
|
const { render } = SassRenderer.create(__dirname);
|
|
15
16
|
|
|
@@ -74,4 +75,24 @@ describe('@carbon/styles/scss/type', () => {
|
|
|
74
75
|
]
|
|
75
76
|
`);
|
|
76
77
|
});
|
|
78
|
+
|
|
79
|
+
test('prefix', async () => {
|
|
80
|
+
const { result } = await render(`
|
|
81
|
+
@use '../config' with (
|
|
82
|
+
$prefix: 'custom',
|
|
83
|
+
);
|
|
84
|
+
@use '../type';
|
|
85
|
+
|
|
86
|
+
.my-selector {
|
|
87
|
+
@include type.type-style('label-01');
|
|
88
|
+
}
|
|
89
|
+
`);
|
|
90
|
+
const { stylesheet } = css.parse(result.css.toString());
|
|
91
|
+
const [rule] = stylesheet.rules;
|
|
92
|
+
for (const declaration of rule.declarations) {
|
|
93
|
+
expect(declaration.value).toEqual(
|
|
94
|
+
expect.stringContaining('var(--custom-')
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
77
98
|
});
|
package/scss/_zone.scss
CHANGED
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
@use './theme';
|
|
13
13
|
// Inline themes depend on layer styles to property reset the layer level
|
|
14
14
|
@use './layer';
|
|
15
|
+
@use './utilities/component-tokens';
|
|
15
16
|
@use './utilities/custom-property';
|
|
17
|
+
@use './components/button/tokens' as button;
|
|
18
|
+
@use './components/notification/tokens' as notification;
|
|
19
|
+
@use './components/tag/tokens' as tag;
|
|
16
20
|
|
|
17
21
|
/// Specify a Map of zones where the key will be used as part of the selector
|
|
18
22
|
/// and the value will be a map used to emit CSS Custom Properties for all color
|
|
@@ -24,6 +28,12 @@ $zones: (
|
|
|
24
28
|
g100: themes.$g100,
|
|
25
29
|
) !default;
|
|
26
30
|
|
|
31
|
+
$-components: (
|
|
32
|
+
button.$button-tokens,
|
|
33
|
+
notification.$notification-tokens,
|
|
34
|
+
tag.$tag-tokens
|
|
35
|
+
);
|
|
36
|
+
|
|
27
37
|
@each $name, $theme in $zones {
|
|
28
38
|
.#{config.$prefix}--#{'' + $name} {
|
|
29
39
|
@each $key, $value in $theme {
|
|
@@ -31,5 +41,27 @@ $zones: (
|
|
|
31
41
|
@include custom-property.declaration($key, $value);
|
|
32
42
|
}
|
|
33
43
|
}
|
|
44
|
+
|
|
45
|
+
@each $group in $-components {
|
|
46
|
+
@each $key, $value in $group {
|
|
47
|
+
@if meta.type-of($value) == map {
|
|
48
|
+
$fallback: map.get($value, fallback);
|
|
49
|
+
$theme-values: map.get($value, values);
|
|
50
|
+
|
|
51
|
+
@each $theme-value in $theme-values {
|
|
52
|
+
$theme: map.get($theme-value, theme);
|
|
53
|
+
$value: map.get($theme-value, value);
|
|
54
|
+
@if theme.matches($theme, theme.$theme) and
|
|
55
|
+
meta.type-of($value) ==
|
|
56
|
+
color
|
|
57
|
+
{
|
|
58
|
+
@include custom-property.declaration($key, $value);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
} @else if meta.type-of($value) == color {
|
|
62
|
+
@include custom-property.declaration($key, $value);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
34
66
|
}
|
|
35
67
|
}
|
|
@@ -112,11 +112,6 @@
|
|
|
112
112
|
left: rem(12px);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
.#{$prefix}--search--md:not(.#{$prefix}--toolbar-search-container-active)
|
|
116
|
-
.#{$prefix}--search-magnifier-icon {
|
|
117
|
-
left: 0;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
115
|
// Large styles
|
|
121
116
|
.#{$prefix}--search--lg .#{$prefix}--search-input,
|
|
122
117
|
.#{$prefix}--search--lg.#{$prefix}--search--expandable.#{$prefix}--search--expanded
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
.#{$prefix}--slider--disabled .#{$prefix}--slider__thumb {
|
|
157
|
-
background-color: $border-
|
|
157
|
+
background-color: $border-disabled;
|
|
158
158
|
|
|
159
159
|
&:hover {
|
|
160
160
|
cursor: not-allowed;
|
|
@@ -162,14 +162,14 @@
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
&:focus {
|
|
165
|
-
background-color: $border-
|
|
165
|
+
background-color: $border-disabled;
|
|
166
166
|
box-shadow: none;
|
|
167
167
|
outline: none;
|
|
168
168
|
transform: translate(-50%, -50%);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
&:active {
|
|
172
|
-
background: $border-
|
|
172
|
+
background: $border-disabled;
|
|
173
173
|
transform: translate(-50%, -50%);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
.#{$prefix}--slider--disabled
|
|
180
180
|
.#{$prefix}--slider__thumb:focus
|
|
181
181
|
~ .#{$prefix}--slider__filled-track {
|
|
182
|
-
background-color: $border-
|
|
182
|
+
background-color: $border-disabled;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
.#{$prefix}--slider--disabled
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
outline: 2px solid transparent;
|
|
35
35
|
outline-offset: -2px;
|
|
36
36
|
|
|
37
|
+
@include type-style('body-compact-01');
|
|
38
|
+
|
|
37
39
|
&:focus {
|
|
38
40
|
@include focus-outline('outline');
|
|
39
41
|
}
|
|
@@ -56,7 +58,6 @@
|
|
|
56
58
|
|
|
57
59
|
.#{$prefix}--tile--clickable {
|
|
58
60
|
@include reset;
|
|
59
|
-
@include type-style('body-compact-01');
|
|
60
61
|
|
|
61
62
|
color: $text-primary;
|
|
62
63
|
text-decoration: none;
|
|
@@ -186,6 +187,8 @@
|
|
|
186
187
|
text-align: left;
|
|
187
188
|
transition: max-height $duration-moderate-01 motion(standard, productive);
|
|
188
189
|
|
|
190
|
+
@include type-style('body-compact-01');
|
|
191
|
+
|
|
189
192
|
&:hover {
|
|
190
193
|
background: $layer-hover;
|
|
191
194
|
}
|