Skip to content

Commit ffc6895

Browse files
chore: dialog t-shirt sizing (#3322)
- adds deprecation notice for --small/--medium/--large class names, in favor of the t-shirt sizing class names. - create changeset - updates metadata.json
1 parent 3e5c46e commit ffc6895

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

.changeset/nasty-pillows-wonder.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@spectrum-css/dialog": patch
3+
---
4+
5+
Dialog t-shirt sizes
6+
7+
Adds support for t-shirt sizing class names to dialog CSS. `@deprecated` comments were added to communicate that the old class names (`--small`, `--medium`, and `--large`) will be removed in S2.
8+
9+
| old class name | new class name |
10+
| ----------------------- | ------------------------------------------------------ |
11+
| spectrum-Dialog--small | spectrum-Dialog--sizeS |
12+
| spectrum-Dialog--medium | spectrum-Dialog (the default, so no size is necessary) |
13+
| spectrum-Dialog--large | spectrum-Dialog--sizeL |

components/dialog/index.css

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@
3636
--spectrum-dialog-confirm-divider-height: var(--spectrum-spacing-50);
3737
}
3838

39-
.spectrum-Dialog {
39+
/* @deprecated .spectrum-Dialog--medium */
40+
.spectrum-Dialog,
41+
.spectrum-Dialog--medium {
4042
/* Be a flexbox to allow a full sized content area that scrolls */
4143
display: flex;
4244

4345
/* Allow 100% width, taking into account padding */
4446
box-sizing: border-box;
4547

46-
/* Be no bigger than max-width, but also be 90% if the viewport is smaller than max-width */
47-
inline-size: fit-content;
48+
/* Be no bigger than max-width, but also be 90% if the viewport is smaller than max-width */
49+
inline-size: var(--mod-dialog-confirm-medium-width, var(--spectrum-dialog-confirm-medium-width));
4850
min-inline-size: var(--mod-dialog-min-inline-size, var(--spectrum-dialog-min-inline-size));
4951
max-inline-size: 100%;
5052

@@ -53,14 +55,14 @@
5355
outline: none;
5456
}
5557

58+
/* @deprecated .spectrum-Dialog--small */
59+
.spectrum-Dialog--sizeS,
5660
.spectrum-Dialog--small {
5761
inline-size: var(--mod-dialog-confirm-small-width, var(--spectrum-dialog-confirm-small-width));
5862
}
5963

60-
.spectrum-Dialog--medium {
61-
inline-size: var(--mod-dialog-confirm-medium-width, var(--spectrum-dialog-confirm-medium-width));
62-
}
63-
64+
/* @deprecated .spectrum-Dialog--large */
65+
.spectrum-Dialog--sizeL,
6466
.spectrum-Dialog--large {
6567
inline-size: var(--mod-dialog-confirm-large-width, var(--spectrum-dialog-confirm-large-width));
6668
}

components/dialog/metadata/metadata.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
".spectrum-Dialog--medium",
2323
".spectrum-Dialog--noDivider .spectrum-Dialog-divider",
2424
".spectrum-Dialog--noDivider .spectrum-Dialog-heading",
25+
".spectrum-Dialog--sizeL",
26+
".spectrum-Dialog--sizeS",
2527
".spectrum-Dialog--small",
2628
".spectrum-Dialog-buttonGroup",
2729
".spectrum-Dialog-buttonGroup.spectrum-Dialog-buttonGroup--noFooter",

0 commit comments

Comments
 (0)