Skip to content

Commit

Permalink
chore: dialog t-shirt sizing (#3322)
Browse files Browse the repository at this point in the history
- adds deprecation notice for --small/--medium/--large class names,
in favor of the t-shirt sizing class names.
- create changeset
- updates metadata.json
  • Loading branch information
marissahuysentruyt authored Oct 31, 2024
1 parent 3e5c46e commit ffc6895
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
13 changes: 13 additions & 0 deletions .changeset/nasty-pillows-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@spectrum-css/dialog": patch
---

Dialog t-shirt sizes

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.

| old class name | new class name |
| ----------------------- | ------------------------------------------------------ |
| spectrum-Dialog--small | spectrum-Dialog--sizeS |
| spectrum-Dialog--medium | spectrum-Dialog (the default, so no size is necessary) |
| spectrum-Dialog--large | spectrum-Dialog--sizeL |
16 changes: 9 additions & 7 deletions components/dialog/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@
--spectrum-dialog-confirm-divider-height: var(--spectrum-spacing-50);
}

.spectrum-Dialog {
/* @deprecated .spectrum-Dialog--medium */
.spectrum-Dialog,
.spectrum-Dialog--medium {
/* Be a flexbox to allow a full sized content area that scrolls */
display: flex;

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

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

Expand All @@ -53,14 +55,14 @@
outline: none;
}

/* @deprecated .spectrum-Dialog--small */
.spectrum-Dialog--sizeS,
.spectrum-Dialog--small {
inline-size: var(--mod-dialog-confirm-small-width, var(--spectrum-dialog-confirm-small-width));
}

.spectrum-Dialog--medium {
inline-size: var(--mod-dialog-confirm-medium-width, var(--spectrum-dialog-confirm-medium-width));
}

/* @deprecated .spectrum-Dialog--large */
.spectrum-Dialog--sizeL,
.spectrum-Dialog--large {
inline-size: var(--mod-dialog-confirm-large-width, var(--spectrum-dialog-confirm-large-width));
}
Expand Down
2 changes: 2 additions & 0 deletions components/dialog/metadata/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
".spectrum-Dialog--medium",
".spectrum-Dialog--noDivider .spectrum-Dialog-divider",
".spectrum-Dialog--noDivider .spectrum-Dialog-heading",
".spectrum-Dialog--sizeL",
".spectrum-Dialog--sizeS",
".spectrum-Dialog--small",
".spectrum-Dialog-buttonGroup",
".spectrum-Dialog-buttonGroup.spectrum-Dialog-buttonGroup--noFooter",
Expand Down

0 comments on commit ffc6895

Please sign in to comment.