Skip to content

Commit f2b25f9

Browse files
committed
fix(toast): scope close button styles to toast
1 parent 772a607 commit f2b25f9

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

components/toast/dist/metadata.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sourceFile": "index.css",
33
"selectors": [
4-
".spectrum-CloseButton",
54
".spectrum-Toast",
65
".spectrum-Toast .spectrum-Button",
6+
".spectrum-Toast .spectrum-CloseButton",
77
".spectrum-Toast--info",
88
".spectrum-Toast--negative",
99
".spectrum-Toast--positive",
@@ -18,6 +18,7 @@
1818
".spectrum-Toast:not(:has(.spectrum-Button))"
1919
],
2020
"modifiers": [
21+
"--mod--spectrum-toast-spacing-block-close-button",
2122
"--mod-toast-background-color-default",
2223
"--mod-toast-corner-radius",
2324
"--mod-toast-font-family",
@@ -59,6 +60,7 @@
5960
"--spectrum-toast-min-block-size",
6061
"--spectrum-toast-negative-background-color-default",
6162
"--spectrum-toast-positive-background-color-default",
63+
"--spectrum-toast-spacing-block-close-button",
6264
"--spectrum-toast-spacing-bottom-edge-to-text",
6365
"--spectrum-toast-spacing-button-to-close-button-horizontal",
6466
"--spectrum-toast-spacing-close-button-to-end-edge",

components/toast/index.css

+6-7
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@
7979
&:not(:has(.spectrum-Button)) {
8080
column-gap: var(--mod-toast-spacing-text-to-close-button, var(--spectrum-toast-spacing-text-to-close-button));
8181
}
82+
83+
.spectrum-CloseButton {
84+
margin-block: var(--mod--spectrum-toast-spacing-block-close-button, var(--spectrum-toast-spacing-block-close-button));
85+
margin-inline-end: var(--mod-toast-spacing-close-button-to-end-edge, var(--spectrum-toast-spacing-close-button-to-end-edge));
86+
flex-shrink: 0;
87+
}
8288
}
8389

8490
.spectrum-Toast--negative {
@@ -105,12 +111,6 @@
105111
margin-inline-start: 0;
106112
}
107113

108-
.spectrum-CloseButton {
109-
margin-block: var(--mod--spectrum-toast-spacing-block-close-button, var(--spectrum-toast-spacing-block-close-button));
110-
margin-inline-end: var(--mod-toast-spacing-close-button-to-end-edge, var(--spectrum-toast-spacing-close-button-to-end-edge));
111-
flex-shrink: 0;
112-
}
113-
114114
.spectrum-Toast .spectrum-Button {
115115
margin-inline-end: var(--mod-toast-spacing-button-to-close-button-horizontal, var(--spectrum-toast-spacing-button-to-close-button-horizontal));
116116
}
@@ -122,7 +122,6 @@
122122
flex: 1 1 auto;
123123
padding-block: var(--mod-toast-spacing-text-to-button-vertical, var(--spectrum-toast-spacing-edge-to-button-vertical));
124124
column-gap: var(--spectrum-toast-spacing-text-to-button-horizontal);
125-
126125
}
127126

128127
.spectrum-Toast-content {

0 commit comments

Comments
 (0)