diff --git a/src/components/alert/alert/alert.scss b/src/components/alert/alert/alert.scss
index 6933ec76a7..b3e797a5e9 100644
--- a/src/components/alert/alert/alert.scss
+++ b/src/components/alert/alert/alert.scss
@@ -17,6 +17,7 @@ $open-anim-opacity-to: 1;
--sbb-alert-padding: var(--sbb-spacing-responsive-xxs) var(--sbb-spacing-responsive-xs);
--sbb-alert-icon-size: #{sbb.px-to-rem-build(20)};
--sbb-alert-close-icon-size: var(--sbb-size-icon-ui-small);
+ --sbb-alert-close-icon-margin: var(--sbb-spacing-responsive-xxs);
--sbb-alert-gap: var(--sbb-spacing-fixed-2x) var(--sbb-spacing-responsive-xs);
--sbb-alert-animation-duration: var(--sbb-animation-duration-6x);
@@ -39,6 +40,11 @@ $open-anim-opacity-to: 1;
--sbb-alert-animation-duration: 0ms;
}
+:host([size='s']) {
+ --sbb-alert-gap: var(--sbb-spacing-fixed-1x) var(--sbb-spacing-responsive-xxs);
+ --sbb-alert-close-icon-margin: var(--sbb-spacing-responsive-xxxs);
+}
+
:host([size='l']) {
--sbb-alert-icon-size: var(--sbb-size-icon-ui-small);
@@ -132,7 +138,7 @@ $open-anim-opacity-to: 1;
.sbb-alert__close-button {
@include sbb.mq($from: small) {
- margin-inline-start: var(--sbb-spacing-responsive-xxs);
+ margin-inline-start: var(--sbb-alert-close-icon-margin);
}
}
diff --git a/src/components/alert/alert/alert.stories.ts b/src/components/alert/alert/alert.stories.ts
index 1987c451a4..c9fff79de7 100644
--- a/src/components/alert/alert/alert.stories.ts
+++ b/src/components/alert/alert/alert.stories.ts
@@ -58,7 +58,7 @@ const size: InputType = {
control: {
type: 'select',
},
- options: ['m', 'l'],
+ options: ['m', 'l', 's'],
};
const readonly: InputType = {
@@ -177,7 +177,13 @@ export const defaultAlert: StoryObj = {
export const sizeL: StoryObj = {
render: Default,
argTypes: defaultArgTypes,
- args: { ...defaultArgs, size: 'l' },
+ args: { ...defaultArgs, size: size.options[1] },
+};
+
+export const sizeS: StoryObj = {
+ render: Default,
+ argTypes: defaultArgTypes,
+ args: { ...defaultArgs, size: size.options[2] },
};
export const withoutCloseButton: StoryObj = {
diff --git a/src/components/alert/alert/alert.ts b/src/components/alert/alert/alert.ts
index 4ef937c905..9444e23aca 100644
--- a/src/components/alert/alert/alert.ts
+++ b/src/components/alert/alert/alert.ts
@@ -44,7 +44,7 @@ export class SbbAlertElement extends SbbIconNameMixin(LitElement) {
@property({ reflect: true, type: Boolean }) public readonly = false;
/** You can choose between `m` or `l` size. */
- @property({ reflect: true }) public size: 'm' | 'l' = 'm';
+ @property({ reflect: true }) public size: 's' | 'm' | 'l' = 'm';
/** Whether the fade in animation should be disabled. */
@property({ attribute: 'disable-animation', type: Boolean }) public disableAnimation = false;
diff --git a/src/components/alert/alert/readme.md b/src/components/alert/alert/readme.md
index 93279fc2fe..61cb4f7127 100644
--- a/src/components/alert/alert/readme.md
+++ b/src/components/alert/alert/readme.md
@@ -57,9 +57,11 @@ which automatically removes an alert after clicking the close button.
## Style
-Users can choose between two `size`, `m` (default) and `l`.
+Users can choose between three `size`: `s`, `m` (default) and `l`.
```html
+