Skip to content
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
merged 2 commits into from
Dec 16, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions assets/js/base/components/select/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Contributor

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. 🙂

Copy link
Contributor Author

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.

// If the theme is in dark mode, as well as the block, then this selector will match.
.has-dark-controls {
.components-custom-select-control__item {
color: $input-text-dark;
}
}

// If the theme is in dark mode, but the block isn't, then this selector will match.
.components-custom-select-control__item {
color: $input-text-active;
}
}