This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Fix select inputs when dark mode is enabled in Twenty Twenty-One #3554
Merged
Conversation
This file contains 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
This is required because the theme may be set to dark mode independently of the browser. The reason we need two rules for this is because the checkout block can be set to have dark mode inputs too, so this rule doesn't need to apply then.
opr
added
status: needs review
type: bug
The issue/PR concerns a confirmed bug.
focus: accessibility
The issue/PR is related to accessibility.
focus: components
Work that introduces new or updates existing components.
block: checkout
Issues related to the checkout block.
focus: global styles
Issues that involve styles/css/layout structure.
labels
Dec 15, 2020
Size Change: +50 B (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
Aljullu
reviewed
Dec 16, 2020
@@ -118,3 +118,18 @@ | |||
display: none; | |||
} | |||
} | |||
|
|||
// This class is set on the body by Twenty Twenty-One when dark mode is active. | |||
.is-dark-theme { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do a full-review, but just a quick note: when writing styles for a specific theme, we usually wrap them in a class, like so: .theme-twentytwentyone { ... }
. You can take the CheckboxControl
styles as a reference. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out, I've updated the pull with this change now.
mikejolley
approved these changes
Dec 16, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well,
github-actions
bot
added
status: ready to merge
and removed
status: needs review
labels
Dec 16, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
block: checkout
Issues related to the checkout block.
focus: accessibility
The issue/PR is related to accessibility.
focus: components
Work that introduces new or updates existing components.
focus: global styles
Issues that involve styles/css/layout structure.
type: bug
The issue/PR concerns a confirmed bug.
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.
Description
This PR adds a new rule to
assets/js/base/components/select/style.scss
for when the classis-dark-theme
exists (it is put on the body by Twenty Twenty-One theme).This PR is required because without it, when the theme is set to dark mode (irrespective of the browser/OS dark mode preference) the text in the select is barely visible.
Fixes #3518
Accessibility
Screenshots
Before
After when block has dark mode inputs enabled
After when block doesn't have dark mode inputs enabled.
How to test the changes in this Pull Request:
npm run build
.Changelog