fix(admin/settings): make tab shell readable in dark mode#2504
Merged
Conversation
Vue's scoped-CSS compiler was dropping the `:global(.dark) .settings-tabs-shell` rules in the production build, so the tab strip kept its light-mode white background and the inactive tab labels (text-gray-300) showed at ~1.6:1 contrast — effectively unreadable. Hoist the three dark-mode overrides into an unscoped `<style>` block so they survive the scoped-CSS transform.
Contributor
|
All contributors have signed the CLA. ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the
/admin/settingspage in dark mode, the tab strip (登录条款 / 功能开关 / 安全与... etc.) keeps a light/white background while the inactive tab labels render intext-gray-300(#d1d5db), giving roughly a 1.6:1 contrast ratio — effectively unreadable.Repro: visit
/admin/settings, toggle dark mode, look at any tab that isn't the active one.Root cause
In
SettingsView.vue's scoped<style>block we have rules like:Vue's scoped-CSS compiler is dropping these three
:global(.dark) …rules from the production build — they don't appear in the compiled stylesheet at all. As a result, the dark-mode overrides for.settings-tabs-shell,.settings-tab::before, and.settings-tab-activenever apply, and the shell stays on its light-mode white background.(Other
dark:Tailwind variants applied inline via@applyon the same elements survive — only the standalone:global(.dark)selectors are affected.)Fix
Hoist the three dark-mode overrides into a second, unscoped
<style>block at the bottom of the file. The selectors (.settings-tabs-shell,.settings-tab::before,.settings-tab-active) are component-specific enough that going unscoped is safe.After the fix:
.settings-tabs-shellshows the intendedrgb(15 23 42 / 0.86)slate background in dark modeTest plan