-
Notifications
You must be signed in to change notification settings - Fork 207
fix(checkbox): corrects invalid+checked+hover background color #3617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@spectrum-css/checkbox": patch | ||
--- | ||
|
||
Adds a `::before` pseudo element to properly target the `.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box` element. The selector update, specifically in the invalid+checked+hover state should now get the proper error background color, as opposed to the default background color. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,7 +158,7 @@ | |
} | ||
|
||
&:hover { | ||
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box, | ||
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box::before, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the reason these styles weren't working is because we need the As I was looking through the other hover styles, trying to understand why they were working but this one wasn't, it seems like every other hover instance is referencing the entire I'm not sure I can correct this bug without it, but I'm very open to other ideas and happy to brainstorm! |
||
.spectrum-Checkbox-box::before { | ||
border-color: var(--highcontrast-checkbox-color-hover, var(--mod-checkbox-invalid-color-hover, var(--spectrum-checkbox-invalid-color-hover))); | ||
} | ||
|
@@ -280,6 +280,7 @@ | |
} | ||
} | ||
|
||
/* TODO: Because this selector was moved to the default variant's styles, this selector block can be deleted when it is safe to make changes to selectors. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a note that we could refactor in the future. I experimented with copying this selector into the default I thought that was too much repetition WITH new selectors, so I opted instead for just reorganizing the selector in the default block. |
||
/* Invalid Hover States */ | ||
&.is-invalid:hover { | ||
&.is-indeterminate .spectrum-Checkbox-box, | ||
|
Uh oh!
There was an error while loading. Please reload this page.