Skip to content

Commit

Permalink
fix: improvements to Toast sizes and spacing (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite authored Jan 10, 2024
1 parent 3dc18f0 commit e9e7df1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/blocks/Toast.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#seeds-toast-stack {
--toast-stack-gap: var(--seeds-s4);
--toast-stack-inset-top: var(--seeds-s3);
--toast-stack-inset-right: var(--seeds-s3);
--toast-stack-max-width: var(--seeds-width-sm);
--toast-stack-inset-top: var(--seeds-s4);
--toast-stack-inset-right: var(--seeds-s4);
--toast-stack-width: auto;

position: fixed;
z-index: var(--seeds-z-index-overlay);
Expand All @@ -11,7 +11,7 @@
gap: var(--toast-stack-gap);
top: var(--toast-stack-inset-top);
right: var(--toast-stack-inset-right);
width: var(--toast-stack-max-width);
width: var(--toast-stack-width);
max-width: calc(100% - var(--toast-stack-inset-right) * 2);
}

Expand Down
12 changes: 6 additions & 6 deletions src/blocks/__stories__/Toast.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import Toast from "../Toast"

In addition, there are a set of variables you can customize via `#toast-stack` which affects the fixed container within which toasts are rendered:

| Name | Description | Default |
| --------------------------- | -------------------------------- | ------------------ |
| `--toast-stack-gap` | Spacing between toasts | `--seeds-s4` |
| `--toast-stack-inset-top` | Window top edge -> stack space | `--seeds-s3` |
| `--toast-stack-inset-right` | Window right edge -> stack space | `--seeds-s3` |
| `--toast-stack-max-width` | Size | `--seeds-width-sm` |
| Name | Description | Default |
| --------------------------- | -------------------------------- | ------------ |
| `--toast-stack-gap` | Spacing between toasts | `--seeds-s4` |
| `--toast-stack-inset-top` | Window top edge -> stack space | `--seeds-s4` |
| `--toast-stack-inset-right` | Window right edge -> stack space | `--seeds-s4` |
| `--toast-stack-width` | Size | `auto` |
2 changes: 1 addition & 1 deletion src/blocks/__stories__/Toast.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const showToasts = () => {
)}
{warning && (
<Toast variant="warn" hideTimeout={5000}>
Warn message!
Warn message! (And a long bit of text to see what happens)
</Toast>
)}
</>
Expand Down

0 comments on commit e9e7df1

Please sign in to comment.