fix: prevent dark mode styles from being used when using light mode#82
Open
pzhlkj6612 wants to merge 1 commit into
Open
fix: prevent dark mode styles from being used when using light mode#82pzhlkj6612 wants to merge 1 commit into
pzhlkj6612 wants to merge 1 commit into
Conversation
Assisted-By: GitHub Copilot
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix #81.
The AI told me to make this fix, then I tried and it worked. Let me try explaining it:
We have
@import "dark-mode.less"in "hux-blog.less":hibikilogy.github.io/less/hux-blog.less
Lines 1 to 5 in 492a71c
In "variables.less" we have
@disabled-bg: @light-disabled-bg, while in "dark-mode.less" we have@disabled-bg: @dark-disabled-bg:hibikilogy.github.io/less/variables.less
Lines 22 to 23 in 492a71c
hibikilogy.github.io/less/dark-mode.less
Lines 16 to 17 in 492a71c
Later
@importsoverrides earlier defined variable. As a result, we got the wrong background color here:hibikilogy.github.io/less/hux-blog.less
Lines 861 to 873 in 492a71c
That's why we couldn't see
!importantin the wrong style of these buttons in light mode.We don't need to import "dark-mode" style into "hux-blog" style because:
the dark mode CSS has already been loaded by "head.html":
hibikilogy.github.io/_includes/head.html
Lines 28 to 32 in 492a71c
That looks really like a bug.
.