From 2d4547ea621e84408cbae8e20db9b05e192ca34f Mon Sep 17 00:00:00 2001 From: Elisa Foltyn Date: Sat, 26 Oct 2024 18:03:40 +0200 Subject: [PATCH] Only add margin to system message container if it contains a joomla-alert (#44222) --- .../templates/site/cassiopeia/scss/blocks/_alerts.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/media_source/templates/site/cassiopeia/scss/blocks/_alerts.scss b/build/media_source/templates/site/cassiopeia/scss/blocks/_alerts.scss index 0db7cf1ee1781..0c5ba36b84ee6 100644 --- a/build/media_source/templates/site/cassiopeia/scss/blocks/_alerts.scss +++ b/build/media_source/templates/site/cassiopeia/scss/blocks/_alerts.scss @@ -23,3 +23,13 @@ transform: translateY(0); } } + +/* Only apply margin when #system-message-container contains a visible joomla-alert */ +#system-message-container:has(joomla-alert) { + margin-top: 1em; +} + +/* Remove margin when no exists */ +#system-message-container:not(:has(joomla-alert)) { + margin-top: 0; +}