Skip to content

Commit 66f33c0

Browse files
committed
fix(actionbutton): reduce mod interception
1 parent 2354c1c commit 66f33c0

File tree

6 files changed

+116
-78
lines changed

6 files changed

+116
-78
lines changed

.changeset/silly-cobras-behave.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@spectrum-css/actionbutton": patch
3+
---
4+
5+
This update aims to simplify `--mod-` access by ensuring local variants and states aren't hooking into those custom properties for overrides. This updates all local variants and states to override the `--spectrum-actionbutton-` properties instead and adjusts the specificity to ensure no regressions in rendered results.
6+
7+
Other changes of note:
8+
9+
- Removes the `.spectrum-ActionButton--sizeM` as unnecessary and duplicate as these styles are applied in the base class.
10+
- Reduces the use of the `:not()` pseudo-class in theme overrides as these selectors are more complex to remap for web component projects.

components/actionbutton/dist/metadata.json

+20-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"selectors": [
44
".spectrum-ActionButton",
55
".spectrum-ActionButton--sizeL",
6-
".spectrum-ActionButton--sizeM",
76
".spectrum-ActionButton--sizeS",
87
".spectrum-ActionButton--sizeXL",
98
".spectrum-ActionButton--sizeXS",
@@ -18,10 +17,9 @@
1817
".spectrum-ActionButton.is-selected .spectrum-ActionButton-hold",
1918
".spectrum-ActionButton.is-selected .spectrum-ActionButton-icon",
2019
".spectrum-ActionButton.is-selected .spectrum-ActionButton-label",
21-
".spectrum-ActionButton.spectrum-ActionButton--emphasized:not(.spectrum-ActionButton--staticBlack, .spectrum-ActionButton--staticWhite)",
20+
".spectrum-ActionButton.spectrum-ActionButton--emphasized",
2221
".spectrum-ActionButton.spectrum-ActionButton--quiet",
2322
".spectrum-ActionButton.spectrum-ActionButton--sizeL",
24-
".spectrum-ActionButton.spectrum-ActionButton--sizeM",
2523
".spectrum-ActionButton.spectrum-ActionButton--sizeS",
2624
".spectrum-ActionButton.spectrum-ActionButton--sizeXL",
2725
".spectrum-ActionButton.spectrum-ActionButton--sizeXS",
@@ -89,7 +87,20 @@
8987
"--mod-actionbutton-icon-size",
9088
"--mod-actionbutton-label-color",
9189
"--mod-actionbutton-min-width",
90+
"--mod-actionbutton-static-black-content-color",
91+
"--mod-actionbutton-static-black-content-color-down",
92+
"--mod-actionbutton-static-black-content-color-down-selected",
93+
"--mod-actionbutton-static-black-content-color-focus",
94+
"--mod-actionbutton-static-black-content-color-focus-selected",
95+
"--mod-actionbutton-static-black-content-color-hover",
96+
"--mod-actionbutton-static-black-content-color-hover-selected",
97+
"--mod-actionbutton-static-black-content-color-selected",
9298
"--mod-actionbutton-static-content-color",
99+
"--mod-actionbutton-static-white-content-color",
100+
"--mod-actionbutton-static-white-content-color-down",
101+
"--mod-actionbutton-static-white-content-color-focus",
102+
"--mod-actionbutton-static-white-content-color-hover",
103+
"--mod-actionbutton-static-white-content-color-selected",
93104
"--mod-actionbutton-text-to-visual",
94105
"--mod-animation-duration-100",
95106
"--mod-line-height-100",
@@ -103,10 +114,14 @@
103114
"--spectrum-action-button-edge-to-hold-icon-small",
104115
"--spectrum-actionbutton-background-color",
105116
"--spectrum-actionbutton-background-color-default",
117+
"--spectrum-actionbutton-background-color-default-selected",
106118
"--spectrum-actionbutton-background-color-disabled",
107119
"--spectrum-actionbutton-background-color-down",
120+
"--spectrum-actionbutton-background-color-down-selected",
108121
"--spectrum-actionbutton-background-color-focus",
122+
"--spectrum-actionbutton-background-color-focus-selected",
109123
"--spectrum-actionbutton-background-color-hover",
124+
"--spectrum-actionbutton-background-color-hover-selected",
110125
"--spectrum-actionbutton-background-color-selected",
111126
"--spectrum-actionbutton-background-color-selected-disabled",
112127
"--spectrum-actionbutton-background-color-selected-down",
@@ -122,6 +137,7 @@
122137
"--spectrum-actionbutton-border-radius-default",
123138
"--spectrum-actionbutton-border-width",
124139
"--spectrum-actionbutton-content-color",
140+
"--spectrum-actionbutton-content-color-disabled",
125141
"--spectrum-actionbutton-content-color-selected",
126142
"--spectrum-actionbutton-edge-to-hold-icon",
127143
"--spectrum-actionbutton-edge-to-text",
@@ -241,6 +257,7 @@
241257
"--system-action-button-border-color-down",
242258
"--system-action-button-border-color-focus",
243259
"--system-action-button-border-color-hover",
260+
"--system-action-button-border-radius-default",
244261
"--system-action-button-content-color-selected",
245262
"--system-action-button-quiet-background-color-default",
246263
"--system-action-button-quiet-background-color-disabled",
@@ -249,7 +266,6 @@
249266
"--system-action-button-quiet-background-color-hover",
250267
"--system-action-button-quiet-background-color-selected-disabled",
251268
"--system-action-button-size-l-border-radius-default",
252-
"--system-action-button-size-m-border-radius-default",
253269
"--system-action-button-size-s-border-radius-default",
254270
"--system-action-button-size-xl-border-radius-default",
255271
"--system-action-button-size-xs-border-radius-default",

0 commit comments

Comments
 (0)