Skip to content

Commit 68e0057

Browse files
authoredFeb 4, 2025··
fix: index-theme system mappings bug (#3534)
Fixes a bug in the content of all component's dist/index-theme.css file. Expected index-theme.css to include the component selectors with component-level custom properties mapped to the --system prefixed ones in order to allow a component to support various contexts. Expected output example for the index-theme.css: ``` .spectrum-ActionButton { --spectrum-actionbutton-background-color-default: var(--system-action-button-background-color-default); --spectrum-actionbutton-background-color-hover: var(--system-action-button-background-color-hover); ```
1 parent 4d0b427 commit 68e0057

File tree

3 files changed

+98
-3
lines changed

3 files changed

+98
-3
lines changed
 

‎.changeset/tender-doors-retire.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
"@spectrum-css/accordion": patch
3+
"@spectrum-css/actionbar": patch
4+
"@spectrum-css/actionbutton": patch
5+
"@spectrum-css/actiongroup": patch
6+
"@spectrum-css/alertbanner": patch
7+
"@spectrum-css/alertdialog": patch
8+
"@spectrum-css/asset": patch
9+
"@spectrum-css/assetcard": patch
10+
"@spectrum-css/assetlist": patch
11+
"@spectrum-css/avatar": patch
12+
"@spectrum-css/badge": patch
13+
"@spectrum-css/breadcrumb": patch
14+
"@spectrum-css/button": patch
15+
"@spectrum-css/buttongroup": patch
16+
"@spectrum-css/calendar": patch
17+
"@spectrum-css/card": patch
18+
"@spectrum-css/checkbox": patch
19+
"@spectrum-css/clearbutton": patch
20+
"@spectrum-css/closebutton": patch
21+
"@spectrum-css/coachindicator": patch
22+
"@spectrum-css/coachmark": patch
23+
"@spectrum-css/colorarea": patch
24+
"@spectrum-css/colorhandle": patch
25+
"@spectrum-css/colorloupe": patch
26+
"@spectrum-css/colorslider": patch
27+
"@spectrum-css/colorwheel": patch
28+
"@spectrum-css/combobox": patch
29+
"@spectrum-css/contextualhelp": patch
30+
"@spectrum-css/datepicker": patch
31+
"@spectrum-css/dial": patch
32+
"@spectrum-css/dialog": patch
33+
"@spectrum-css/divider": patch
34+
"@spectrum-css/dropindicator": patch
35+
"@spectrum-css/dropzone": patch
36+
"@spectrum-css/fieldgroup": patch
37+
"@spectrum-css/fieldlabel": patch
38+
"@spectrum-css/floatingactionbutton": patch
39+
"@spectrum-css/form": patch
40+
"@spectrum-css/helptext": patch
41+
"@spectrum-css/icon": patch
42+
"@spectrum-css/illustratedmessage": patch
43+
"@spectrum-css/infieldbutton": patch
44+
"@spectrum-css/inlinealert": patch
45+
"@spectrum-css/link": patch
46+
"@spectrum-css/logicbutton": patch
47+
"@spectrum-css/menu": patch
48+
"@spectrum-css/meter": patch
49+
"@spectrum-css/miller": patch
50+
"@spectrum-css/modal": patch
51+
"@spectrum-css/opacitycheckerboard": patch
52+
"@spectrum-css/page": patch
53+
"@spectrum-css/pagination": patch
54+
"@spectrum-css/picker": patch
55+
"@spectrum-css/pickerbutton": patch
56+
"@spectrum-css/popover": patch
57+
"@spectrum-css/progressbar": patch
58+
"@spectrum-css/progresscircle": patch
59+
"@spectrum-css/radio": patch
60+
"@spectrum-css/rating": patch
61+
"@spectrum-css/search": patch
62+
"@spectrum-css/sidenav": patch
63+
"@spectrum-css/slider": patch
64+
"@spectrum-css/splitview": patch
65+
"@spectrum-css/statuslight": patch
66+
"@spectrum-css/steplist": patch
67+
"@spectrum-css/stepper": patch
68+
"@spectrum-css/swatch": patch
69+
"@spectrum-css/swatchgroup": patch
70+
"@spectrum-css/switch": patch
71+
"@spectrum-css/table": patch
72+
"@spectrum-css/tabs": patch
73+
"@spectrum-css/tag": patch
74+
"@spectrum-css/taggroup": patch
75+
"@spectrum-css/textfield": patch
76+
"@spectrum-css/thumbnail": patch
77+
"@spectrum-css/toast": patch
78+
"@spectrum-css/tooltip": patch
79+
"@spectrum-css/tray": patch
80+
"@spectrum-css/treeview": patch
81+
"@spectrum-css/typography": patch
82+
"@spectrum-css/underlay": patch
83+
"@spectrum-css/well": patch
84+
---
85+
86+
Fixes a bug in the content of the `dist/index-theme.css` file.
87+
88+
Expected `index-theme.css` to include the component selectors with component-level custom properties mapped to the `--system` prefixed ones in order to allow a component to support various contexts.
89+
90+
Expected output example for the index-theme.css:
91+
92+
```
93+
.spectrum-ActionButton {
94+
--spectrum-actionbutton-background-color-default: var(--system-action-button-background-color-default);
95+
--spectrum-actionbutton-background-color-hover: var(--system-action-button-background-color-hover);
96+
```

‎tasks/component-builder.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ async function buildThemes({ cwd = process.cwd(), clean = false } = {}) {
236236
clean,
237237
resolveImports: true,
238238
skipMapping: false,
239-
stripLocalSelectors: true,
240-
referencesOnly: false,
239+
stripLocalSelectors: false,
240+
referencesOnly: true,
241241
shouldCombine: false,
242242
map: false,
243243
},

‎tasks/component-reporter.js

-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ async function main({
138138
componentName = process.env.NX_TASK_TARGET_PROJECT,
139139
cwd,
140140
} = {}) {
141-
console.log("componentName", componentName);
142141
if (!cwd && componentName) {
143142
cwd = path.join(dirs.components, componentName);
144143
}

0 commit comments

Comments
 (0)
Please sign in to comment.