Skip to content

Commit 52241c4

Browse files
committed
feat(icon): remove modifiers from the API [SWC-1264]
1 parent bdc66c9 commit 52241c4

File tree

9 files changed

+531
-602
lines changed

9 files changed

+531
-602
lines changed

.changeset/weak-colts-divide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"@spectrum-css/miller": major
99
"@spectrum-css/well": major
1010
"@spectrum-css/page": major
11+
"@spectrum-css/icon": major
1112
---
1213

1314
This update removes `--mod-*` custom property hooks per SWC-1264, see also the RFC for extensible styling. In addition, this update cleans up any component-level custom properties that did not rely on the CSS cascade to define the styles; this was done to reduce the number of custom properties that are defined at the component level and trim down the size of the CSS we are shipping to consumers.

components/icon/dist/metadata.json

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
".spectrum-Icon",
55
".spectrum-Icon img",
66
".spectrum-Icon svg",
7-
".spectrum-Icon--sizeL",
8-
".spectrum-Icon--sizeS",
9-
".spectrum-Icon--sizeXL",
10-
".spectrum-Icon--sizeXS",
11-
".spectrum-Icon--sizeXXL",
12-
".spectrum-Icon--sizeXXS",
13-
".spectrum-UIIcon",
7+
".spectrum-Icon:where(.spectrum-Icon--sizeL)",
8+
".spectrum-Icon:where(.spectrum-Icon--sizeS)",
9+
".spectrum-Icon:where(.spectrum-Icon--sizeXL)",
10+
".spectrum-Icon:where(.spectrum-Icon--sizeXS)",
1411
".spectrum-UIIcon-Add100",
1512
".spectrum-UIIcon-Add200",
1613
".spectrum-UIIcon-Add300",
@@ -114,17 +111,8 @@
114111
".spectrum-UIIcon-LinkOut400",
115112
".spectrum-UIIcon-LinkOut75"
116113
],
117-
"modifiers": [
118-
"--mod-icon-block-size",
119-
"--mod-icon-color",
120-
"--mod-icon-inline-size",
121-
"--mod-icon-size"
122-
],
123-
"component": [
124-
"--spectrum-icon-block-size",
125-
"--spectrum-icon-inline-size",
126-
"--spectrum-icon-size"
127-
],
114+
"modifiers": [],
115+
"component": ["--spectrum-icon-size"],
128116
"global": [
129117
"--spectrum-add-icon-size-100",
130118
"--spectrum-add-icon-size-200",
@@ -190,9 +178,7 @@
190178
"--spectrum-workflow-icon-size-200",
191179
"--spectrum-workflow-icon-size-300",
192180
"--spectrum-workflow-icon-size-50",
193-
"--spectrum-workflow-icon-size-75",
194-
"--spectrum-workflow-icon-size-xxl",
195-
"--spectrum-workflow-icon-size-xxs"
181+
"--spectrum-workflow-icon-size-75"
196182
],
197183
"passthroughs": [],
198184
"high-contrast": []

components/icon/icons.css

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)