Skip to content

Commit 4b3e4c9

Browse files
committed
chore(toast): update tokens values for s2
1 parent 27b3b03 commit 4b3e4c9

File tree

6 files changed

+22
-61
lines changed

6 files changed

+22
-61
lines changed

components/toast/index.css

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ governing permissions and limitations under the License.
1717
/* Size */
1818

1919
--spectrum-toast-font-size: var(--spectrum-font-size-100);
20-
--spectrum-toast-corner-radius: var(--spectrum-corner-radius-100);
20+
--spectrum-toast-corner-radius: var(--spectrum-corner-radius-800);
2121
--spectrum-toast-block-size: var(--spectrum-toast-height);
2222
--spectrum-toast-max-inline-size: var(--spectrum-toast-maximum-width);
2323
--spectrum-toast-border-width: var(--spectrum-border-width-100);
@@ -27,34 +27,33 @@ governing permissions and limitations under the License.
2727

2828
/* Space */
2929

30-
--spectrum-toast-spacing-icon-to-text: var(--spectrum-text-to-visual-100);
30+
--spectrum-toast-spacing-icon-to-text: var(--spectrum-text-to-visual-300);
3131

3232
--spectrum-toast-spacing-start-edge-to-text-and-icon: var(--spectrum-spacing-300);
3333
--spectrum-toast-spacing-text-and-action-button-to-divider: var(--spectrum-spacing-300);
34+
--spectrum-toast-spacing-text-to-close-button: var(--spectrum-spacing-300);
3435

35-
--spectrum-toast-spacing-top-edge-to-divider: var(--spectrum-spacing-100);
36-
--spectrum-toast-spacing-bottom-edge-to-divider: var(--spectrum-spacing-100);
36+
--spectrum-toast-spacing-top-edge-to-divider: var(--spectrum-spacing-200);
37+
--spectrum-toast-spacing-bottom-edge-to-divider: var(--spectrum-spacing-200);
3738

3839
--spectrum-toast-spacing-top-edge-to-icon: var(--spectrum-toast-top-to-workflow-icon);
3940

40-
--spectrum-toast-spacing-text-to-action-button-horizontal: var(--spectrum-spacing-300);
41+
--spectrum-toast-spacing-text-to-action-button-horizontal: var(--spectrum-spacing-400);
4142
--spectrum-toast-spacing-close-button: var(--spectrum-spacing-100);
4243

43-
--spectrum-toast-spacing-block-start: var(--spectrum-spacing-100);
44-
--spectrum-toast-spacing-block-end: var(--spectrum-spacing-100);
44+
--spectrum-toast-spacing-block-start: var(--spectrum-spacing-200);
45+
--spectrum-toast-spacing-block-end: var(--spectrum-spacing-200);
4546

4647
--spectrum-toast-spacing-top-edge-to-text: var(--spectrum-toast-top-to-text);
4748
--spectrum-toast-spacing-bottom-edge-to-text: var(--spectrum-toast-bottom-to-text);
4849

4950
/* Color */
50-
51+
--spectrum-toast-background-color-default: var(--spectrum-neutral-subdued-background-color-default);
5152
--spectrum-toast-negative-background-color-default: var(--spectrum-negative-background-color-default);
5253
--spectrum-toast-positive-background-color-default: var(--spectrum-positive-background-color-default);
5354
--spectrum-toast-informative-background-color-default: var(--spectrum-informative-background-color-default);
5455

5556
--spectrum-toast-text-and-icon-color: var(--spectrum-white);
56-
57-
--spectrum-toast-divider-color: var(--spectrum-transparent-white-300);
5857
}
5958

6059
@media (forced-colors: active) {
@@ -132,9 +131,8 @@ governing permissions and limitations under the License.
132131

133132
padding-block-start: calc(var(--mod-toast-spacing-top-edge-to-text, var(--spectrum-toast-spacing-top-edge-to-text)) - var(--mod-toast-spacing-block-start, var(--spectrum-toast-spacing-block-start)));
134133
padding-block-end: calc(var(--mod-toast-spacing-bottom-edge-to-text, var(--spectrum-toast-spacing-bottom-edge-to-text)) - var(--mod-toast-spacing-block-end, var(--spectrum-toast-spacing-block-end)));
135-
136-
padding-inline-end: var(--mod-toast-spacing-text-to-action-button-horizontal, var(--spectrum-toast-spacing-text-to-action-button-horizontal));
137134
padding-inline-start: 0;
135+
padding-inline-end: var(--mod-toast-spacing-text-to-close-button, var(--spectrum-toast-spacing-text-to-close-button));
138136

139137
line-height: var(--mod-toast-line-height, var(--spectrum-toast-line-height));
140138

@@ -149,6 +147,12 @@ governing permissions and limitations under the License.
149147
}
150148
}
151149

150+
.spectrum-Toast:has(.spectrum-Button) {
151+
.spectrum-Toast-content {
152+
padding-inline-end: var(--mod-toast-spacing-text-to-action-button-horizontal, var(--spectrum-toast-spacing-text-to-action-button-horizontal));
153+
}
154+
}
155+
152156
.spectrum-Toast-buttons {
153157
display: flex;
154158
flex: 0 0 auto;
@@ -158,7 +162,7 @@ governing permissions and limitations under the License.
158162
margin-block-end: var(--mod-toast-spacing-bottom-edge-to-divider, var(--spectrum-toast-spacing-bottom-edge-to-divider));
159163

160164
/* Divider color for Text | Action Button */
161-
border-inline-start-color: var(--mod-toast-divider-color, var(--spectrum-toast-divider-color));
165+
/* border-inline-start-color: var(--mod-toast-divider-color, var(--spectrum-toast-divider-color)); */
162166
padding-inline-end: var(--mod-toast-spacing-close-button, var(--spectrum-toast-spacing-close-button));
163167

164168
.spectrum-CloseButton {
@@ -191,8 +195,5 @@ governing permissions and limitations under the License.
191195

192196
& + .spectrum-Toast-buttons {
193197
padding-inline-start: var(--mod-toast-spacing-close-button, var(--spectrum-toast-spacing-close-button));
194-
195-
border-inline-start-width: 1px;
196-
border-inline-start-style: solid;
197198
}
198199
}

components/toast/metadata/mods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
| `--mod-toast-block-size` |
55
| `--mod-toast-border-width` |
66
| `--mod-toast-corner-radius` |
7-
| `--mod-toast-divider-color` |
87
| `--mod-toast-font-size` |
98
| `--mod-toast-font-weight` |
109
| `--mod-toast-informative-background-color-default` |
@@ -22,6 +21,7 @@
2221
| `--mod-toast-spacing-start-edge-to-text-and-icon` |
2322
| `--mod-toast-spacing-text-and-action-button-to-divider` |
2423
| `--mod-toast-spacing-text-to-action-button-horizontal` |
24+
| `--mod-toast-spacing-text-to-close-button` |
2525
| `--mod-toast-spacing-top-edge-to-divider` |
2626
| `--mod-toast-spacing-top-edge-to-icon` |
2727
| `--mod-toast-spacing-top-edge-to-text` |

components/toast/stories/template.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { html } from "lit";
22
import { classMap } from "lit/directives/class-map.js";
33
import { ifDefined } from "lit/directives/if-defined.js";
44

5-
import { Template as Icon } from "@spectrum-css/icon/stories/template.js";
6-
import { Template as CloseButton } from "@spectrum-css/closebutton/stories/template.js";
75
import { Template as Button } from "@spectrum-css/button/stories/template.js";
6+
import { Template as CloseButton } from "@spectrum-css/closebutton/stories/template.js";
7+
import { Template as Icon } from "@spectrum-css/icon/stories/template.js";
88

99
import "../index.css";
1010

@@ -19,16 +19,8 @@ export const Template = ({
1919
id,
2020
...globals
2121
}) => {
22-
const { express } = globals;
23-
24-
try {
25-
if (!express) import(/* webpackPrefetch: true */ "../themes/spectrum.css");
26-
else import(/* webpackPrefetch: true */ "../themes/express.css");
27-
} catch (e) {
28-
console.warn(e);
29-
}
3022

31-
const iconName =
23+
const iconName =
3224
variant === "negative"
3325
? "Alert"
3426
: variant === "positive"

components/toast/stories/toast.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ Positive.args = {
7575
variant: "positive",
7676
message: "Copied to clipboard",
7777
inlineButtonLabel: "Eject",
78-
};
78+
};

components/toast/themes/express.css

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

components/toast/themes/spectrum.css

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

0 commit comments

Comments
 (0)