From f7ac71ef6cea4fe308a56a12d673699070b0a820 Mon Sep 17 00:00:00 2001 From: Frankie Yan Date: Wed, 23 Oct 2024 16:36:15 -0700 Subject: [PATCH] Fix alignment when close button is not present --- src/alert/alert.module.css | 9 ++++++++- src/alert/alert.tsx | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/alert/alert.module.css b/src/alert/alert.module.css index d5b95121a..926df0f82 100644 --- a/src/alert/alert.module.css +++ b/src/alert/alert.module.css @@ -3,8 +3,15 @@ border-width: 1px; color: var(--reactist-content-primary); padding: var(--reactist-spacing-small); +} + +.content { /* this is to make sure it always has the same minimum height, whether it has a close button or not */ - min-height: calc(2 * var(--reactist-spacing-small) + var(--reactist-button-small-height) + 2px); + min-height: var(--reactist-button-small-height); +} + +.icon { + display: block; } .tone-info { diff --git a/src/alert/alert.tsx b/src/alert/alert.tsx index cbb1eff18..bce2f8fc3 100644 --- a/src/alert/alert.tsx +++ b/src/alert/alert.tsx @@ -35,14 +35,15 @@ function Alert({ id, children, tone, closeLabel, onClose }: AlertProps) { > - - - + {children}