From 079bacf3a6eb6ea36c781ef568d14d1273a3685d Mon Sep 17 00:00:00 2001 From: LOUIS POTEVIN Date: Wed, 27 May 2026 13:23:51 +0200 Subject: [PATCH] feat: refactor notification styles and structure --- .../Notifications/_notification.scss | 114 +++++++++--------- .../Notifications/notification.astro | 6 +- 2 files changed, 57 insertions(+), 63 deletions(-) diff --git a/src/components/Notifications/_notification.scss b/src/components/Notifications/_notification.scss index 044041d..ca01cc7 100644 --- a/src/components/Notifications/_notification.scss +++ b/src/components/Notifications/_notification.scss @@ -1,67 +1,61 @@ +@use '../../styles/tokens/typography' as *; + .notification { display: flex; + justify-content: space-between; align-items: center; - gap: var(--nds-spacing-sm); - padding: var(--nds-spacing-sm) var(--nds-spacing-md); + padding: var(--nds-spacing-sm) var(--nds-spacing-xs) ; border-radius: var(--nds-radius-md); - border: var(--nds-border-width-thin) solid; - font-family: var(--nds-font-family-base); - font-size: var(--nds-type-body-medium-size); - font-weight: var(--nds-type-body-medium-weight); - letter-spacing: var(--nds-type-body-medium-letter-spacing); - - &__content { - flex: 1; - line-height: 1.5; - } - - &__close { - flex-shrink: 0; - display: flex; - align-items: center; - justify-content: center; - background: none; - border: none; - padding: 0; - cursor: pointer; - color: inherit; - opacity: 0.7; - - &:hover { - opacity: 1; - } - - &:focus-visible { - outline: 2px solid var(--nds-focus-ring); - outline-offset: 2px; - border-radius: var(--nds-radius-xs); - } - &--error { - color: var(--nds-error-medium); - } - } - - &--info { - background-color: var(--nds-info-low); - border-color: var(--nds-info-medium); - color: var(--nds-info-high); - } - - &--success { - background-color: var(--nds-correct-low); - border-color: var(--nds-correct-medium); - color: var(--nds-correct-high); - } - - &--warning { - background-color: var(--nds-warning-low); - border-color: var(--nds-warning-medium); - color: var(--nds-warning-high); - } - - &--error { + @include text-sm; + &__error { background-color: var(--nds-error-low); - border-color: var(--nds-error-medium); - color: var(--nds-error-high); + &__close { + background: transparent; + border: none; + color: var(--nds-error-medium); + cursor: pointer; + } + &__content { + color: var(--nds-error-high); + } + } + + &__success { + background-color: var(--nds-success-low); + &__close { + background: transparent; + border: none; + color: var(--nds-success-medium); + cursor: pointer; + } + &__content { + color: var(--nds-success-high); + } + } + + &__warning { + background-color: var(--nds-warning-low); + &__close { + background: transparent; + border: none; + color: var(--nds-warning-medium); + cursor: pointer; + } + &__content { + color: var(--nds-warning-high); + } + } + + &__info { + background-color: var(--nds-info-low); + &__close { + background: transparent; + border: none; + color: var(--nds-info-medium); + cursor: pointer; + } + &__content { + color: var(--nds-info-high); + } } } diff --git a/src/components/Notifications/notification.astro b/src/components/Notifications/notification.astro index dfd0c57..403a115 100644 --- a/src/components/Notifications/notification.astro +++ b/src/components/Notifications/notification.astro @@ -9,11 +9,11 @@ const notificationUUID = `notification-${Math.random().toString(36).substr(2, 9 const { type } = Astro.props; --- -