From 37ebaf4c3c719a8edeb760570dd0611ed87e4ce6 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 5 Aug 2025 10:44:26 -0400 Subject: [PATCH] DEV: merge post-action-feedback CSS into common file (#34080) Concerns this button feedback image This change is pretty straightforward, the desktop css includes all styling for the `.post-action-feedback-alert`, so that can be simply moved to common. The mobile alert was removed by https://github.com/discourse/discourse/pull/31375 (because we open a link modal instead)... so the mobile styles aren't actually applied anywhere (no plugins either). --- .../common/post-action-feedback.scss | 39 +++++++++++++++++++ app/assets/stylesheets/desktop/_index.scss | 1 - .../desktop/post-action-feedback.scss | 38 ------------------ app/assets/stylesheets/mobile/_index.scss | 1 - .../mobile/post-action-feedback.scss | 39 ------------------- 5 files changed, 39 insertions(+), 79 deletions(-) delete mode 100644 app/assets/stylesheets/desktop/post-action-feedback.scss delete mode 100644 app/assets/stylesheets/mobile/post-action-feedback.scss diff --git a/app/assets/stylesheets/common/post-action-feedback.scss b/app/assets/stylesheets/common/post-action-feedback.scss index 7a8d2d1c774..2765ae29f31 100644 --- a/app/assets/stylesheets/common/post-action-feedback.scss +++ b/app/assets/stylesheets/common/post-action-feedback.scss @@ -36,3 +36,42 @@ } } } + +.post-action-feedback-alert { + position: absolute; + top: -1.5rem; + left: 60%; + transform: translateX(-50%); + color: var(--success); + padding: 0.25rem 0.5rem; + white-space: nowrap; + font-size: var(--font-down-2); + opacity: 0; + z-index: calc(z("timeline") + 1); +} + +.--transition { + .post-action-feedback-alert, + .post-action-feedback-svg { + transition: + opacity 0.25s, + color 0.25s; + } +} + +.--activated { + .post-action-feedback-alert, + .post-action-feedback-svg { + opacity: 1; + } + + .post-action-feedback-alert { + &.-success { + color: var(--success); + } + + &.-fail { + color: var(--danger); + } + } +} diff --git a/app/assets/stylesheets/desktop/_index.scss b/app/assets/stylesheets/desktop/_index.scss index c0a81e5e217..19fd454168e 100644 --- a/app/assets/stylesheets/desktop/_index.scss +++ b/app/assets/stylesheets/desktop/_index.scss @@ -2,7 +2,6 @@ @import "latest-topic-list"; @import "login-signup-page"; @import "modal"; -@import "post-action-feedback"; @import "topic"; @import "topic-list"; @import "topic-post"; diff --git a/app/assets/stylesheets/desktop/post-action-feedback.scss b/app/assets/stylesheets/desktop/post-action-feedback.scss deleted file mode 100644 index 71a9204ae4a..00000000000 --- a/app/assets/stylesheets/desktop/post-action-feedback.scss +++ /dev/null @@ -1,38 +0,0 @@ -.post-action-feedback-alert { - position: absolute; - top: -1.5rem; - left: 60%; - transform: translateX(-50%); - color: var(--success); - padding: 0.25rem 0.5rem; - white-space: nowrap; - font-size: var(--font-down-2); - opacity: 0; - z-index: calc(z("timeline") + 1); -} - -.--transition { - .post-action-feedback-alert, - .post-action-feedback-svg { - transition: - opacity 0.25s, - color 0.25s; - } -} - -.--activated { - .post-action-feedback-alert, - .post-action-feedback-svg { - opacity: 1; - } - - .post-action-feedback-alert { - &.-success { - color: var(--success); - } - - &.-fail { - color: var(--danger); - } - } -} diff --git a/app/assets/stylesheets/mobile/_index.scss b/app/assets/stylesheets/mobile/_index.scss index f2d426806b9..f14d733ac8e 100644 --- a/app/assets/stylesheets/mobile/_index.scss +++ b/app/assets/stylesheets/mobile/_index.scss @@ -1,6 +1,5 @@ @import "login-signup-page"; @import "modal"; -@import "post-action-feedback"; @import "push-notifications-mobile"; @import "topic-list"; @import "topic-post"; diff --git a/app/assets/stylesheets/mobile/post-action-feedback.scss b/app/assets/stylesheets/mobile/post-action-feedback.scss deleted file mode 100644 index 40b3ab01f5b..00000000000 --- a/app/assets/stylesheets/mobile/post-action-feedback.scss +++ /dev/null @@ -1,39 +0,0 @@ -@keyframes d-toast-opening { - from { - transform: translateY(var(--transform-y, 10px)); - } -} - -.post-action-feedback-alert { - --transform-y: 0; - position: fixed; - top: calc(var(--header-offset) + 0.5rem); - left: 0; - right: 0; - margin-inline: 0.5rem; - z-index: z("max"); - display: flex; - box-sizing: border-box; - padding: 1em 1.5em; - opacity: 1; - transition: opacity 0.5s; - border-radius: var(--d-border-radius); - color: var(--primary); - overflow: hidden; - background-color: var(--tertiary-very-low); - border: 1px solid var(--content-border-color); - box-shadow: var(--shadow-dropdown); - overflow-wrap: break-word; - animation: d-toast-opening 0.3s ease-in-out; - will-change: transform; - - &.-fade-out { - opacity: 0; - } -} - -@media (prefers-reduced-motion: no-preference) { - .post-action-feedback-alert { - --transform-y: 2vh; - } -}