@carbon/styles 1.1.0 → 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.
|
|
4
|
+
"version": "1.2.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@carbon/grid": "^11.1.0",
|
|
33
33
|
"@carbon/layout": "^11.1.0",
|
|
34
34
|
"@carbon/motion": "^11.0.0",
|
|
35
|
-
"@carbon/themes": "^11.
|
|
36
|
-
"@carbon/type": "^11.
|
|
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": {
|
|
@@ -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
|
|
@@ -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
|
}
|