Skip to content

Commit 945da3b

Browse files
committed
feat(icon): remove modifiers from the API [SWC-1264]
1 parent f364c4f commit 945da3b

File tree

19 files changed

+546
-618
lines changed

19 files changed

+546
-618
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/alertbanner/dist/metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"--spectrum-border-width-100",
7474
"--spectrum-cjk-line-height-100",
7575
"--spectrum-font-size-100",
76+
"--spectrum-icon-size",
7677
"--spectrum-informative-background-color-default",
7778
"--spectrum-line-height-100",
7879
"--spectrum-negative-background-color-default",
@@ -87,8 +88,7 @@
8788
"passthroughs": [
8889
"--mod-closebutton-align-self",
8990
"--mod-closebutton-margin-inline",
90-
"--mod-closebutton-margin-top",
91-
"--mod-icon-size"
91+
"--mod-closebutton-margin-top"
9292
],
9393
"high-contrast": [
9494
"--highcontrast-alert-banner-border-color",

components/alertbanner/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109
.spectrum-AlertBanner-icon {
110110
/* @passthrough -- icon-size */
111-
--mod-icon-size: var(--mod-alert-banner-icon-size, var(--spectrum-alert-banner-icon-size));
111+
--spectrum-icon-size: var(--mod-alert-banner-icon-size, var(--spectrum-alert-banner-icon-size));
112112

113113
margin-block-start: calc(var(--mod-alert-banner-top-to-icon, var(--spectrum-alert-banner-top-to-workflow-icon)) - var(--mod-alert-banner-block-edge-to-button, var(--spectrum-alert-banner-block-edge-to-button)));
114114
margin-inline-end: var(--mod-alert-banner-icon-to-text, var(--spectrum-alert-banner-icon-to-text));

components/datepicker/stories/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const DatePicker = ({
9090
iconName: "Calendar",
9191
iconSet: "workflow",
9292
isQuiet,
93-
customStyles: isReadOnly ? { "display": "none" } : { "--mod-icon-size": "var(--spectrum-workflow-icon-size-50)" },
93+
customStyles: isReadOnly ? { "display": "none" } : { "--spectrum-icon-size": "var(--spectrum-workflow-icon-size-50)" },
9494
// @todo this is not added to the button on the website; need to make sure it's not a bug
9595
// isOpen,
9696
isInvalid,

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)