From bfba0ccaaef963a8782ef4e82664512b23bc75e5 Mon Sep 17 00:00:00 2001 From: Anton BL Date: Thu, 20 Nov 2025 14:36:49 -0500 Subject: [PATCH] Fixes #20827: fix theme toggle visibility for logo and buttons (#20835) --- netbox/project-static/dist/netbox.css | Bin 556759 -> 557056 bytes .../styles/overrides/_tabler.scss | 15 +++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/netbox/project-static/dist/netbox.css b/netbox/project-static/dist/netbox.css index 69451890f7ed8313cecb0df6580e127131c365a3..19bcf14d617c56f793b8320976b2c078ac0b7736 100644 GIT binary patch delta 217 zcmccqSFxc%siB3jg{g(Pg{6hHg{_5s3&+9)A*-VN{1U6Y{1Oell+xVXN==37iu+iE zr`LrrvZ*TQWn`wL>Xu}r=BDcAWTt17=wMNQFor{Fde}Y|9bQy(K;p{87y!3W2*tvb o#G>r#=?5PIU32a*GtYEsH4d)n6FfQCroR#6;Mu+}fkRRb0OIsYUjP6A delta 41 xcmZo@P`dtCv7v>rg{g(Pg{6hHg{_5s3&+BQ>3D<>1`@A(2Bs4gg8k4&49% diff --git a/netbox/project-static/styles/overrides/_tabler.scss b/netbox/project-static/styles/overrides/_tabler.scss index d8d83e707..a22c968e0 100644 --- a/netbox/project-static/styles/overrides/_tabler.scss +++ b/netbox/project-static/styles/overrides/_tabler.scss @@ -162,3 +162,18 @@ pre code { vertical-align: .05em; height: auto; } + +// Theme-based visibility utilities +// Tabler's .hide-theme-* utilities expect data-bs-theme on :root, but NetBox applies +// it to body. These overrides use higher specificity selectors to ensure theme-based +// visibility works correctly. The :root:not(.dummy) pattern provides the additional +// specificity needed to override Tabler's :root:not() rules. +:root:not(.dummy) body[data-bs-theme='light'] .hide-theme-light, +:root:not(.dummy) body[data-bs-theme='dark'] .hide-theme-dark { + display: none !important; +} + +:root:not(.dummy) body[data-bs-theme='dark'] .hide-theme-light, +:root:not(.dummy) body[data-bs-theme='light'] .hide-theme-dark { + display: inline-flex !important; +}