-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add WHCM support for all the form elements #2830
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
5ba857c
1c01b22
1cbc0ea
3d9b038
43b053e
984793b
71fbb79
1aa3afa
b0ba6fc
ccffaf7
138b2c4
72a7654
8d74956
8c79395
bb33844
92b7504
6a16ca6
7703542
f45332b
f7cda1f
a7f7d39
e572c56
78b6f4c
ab8cd95
26121dc
15c8429
1b3cb8a
4f629a7
acd7ce3
c3a89fa
38acf7c
e873aab
c326a87
fafdfb2
b4b6d7f
250c061
2652796
9ef0248
75b1a32
f041a65
06d95f1
e29d077
26a3d97
6726f83
d90330e
3930fec
de82ec6
c0c88ac
23fe1e0
0ee5bc5
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| /* | ||
| /* | ||
| Copyright 2019 Adobe. All rights reserved. | ||
| This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. You may obtain a copy | ||
|
|
@@ -207,3 +207,62 @@ governing permissions and limitations under the License. | |
| } | ||
| } | ||
| } | ||
| @media (forced-colors: active) { | ||
| .spectrum-Checkbox { | ||
| forced-color-adjust: none; | ||
| --spectrum-checkbox-box-border-color: ButtonText; | ||
| --spectrum-checkbox-box-border-color-error: Highlight; | ||
| --spectrum-checkbox-box-border-color-error-down: Highlight; | ||
| --spectrum-checkbox-box-border-color-error-hover: Highlight; | ||
| --spectrum-checkbox-box-border-color-key-focus: Highlight; | ||
| --spectrum-checkbox-checkmark-color: HighlightText; | ||
| --spectrum-checkbox-emphasized-box-background-color: ButtonFace; | ||
| --spectrum-checkbox-emphasized-box-background-color-disabled: ButtonFace; | ||
| --spectrum-checkbox-emphasized-box-border-color: ButtonText; | ||
| --spectrum-checkbox-emphasized-box-border-color-disabled: GrayText; | ||
| --spectrum-checkbox-emphasized-box-border-color-down: Highlight; | ||
| --spectrum-checkbox-emphasized-box-border-color-hover: Highlight; | ||
| --spectrum-checkbox-emphasized-box-border-color-selected: Highlight; | ||
| --spectrum-checkbox-emphasized-box-border-color-selected-down: Highlight; | ||
| --spectrum-checkbox-emphasized-box-border-color-selected-hover: Highlight; | ||
| --spectrum-checkbox-emphasized-box-border-color-selected-key-focus: Highlight; | ||
| --spectrum-checkbox-emphasized-text-color: FieldText; | ||
| --spectrum-checkbox-emphasized-text-color-down: FieldText; | ||
| --spectrum-checkbox-emphasized-text-color-hover: FieldText; | ||
| --spectrum-checkbox-emphasized-text-color-key-focus: FieldText; | ||
| --spectrum-checkbox-focus-ring-color-key-focus: ButtonText; | ||
| --spectrum-checkbox-quiet-box-border-color-selected: Highlight; | ||
| --spectrum-checkbox-quiet-box-border-color-selected-down: Highlight; | ||
| --spectrum-checkbox-quiet-box-border-color-selected-hover: Highlight; | ||
| --spectrum-checkbox-text-color: FieldText; | ||
| --spectrum-checkbox-text-color-disabled: GrayText; | ||
| --spectrum-checkbox-text-color-error: FieldText; | ||
| --spectrum-checkbox-text-color-error-down: FieldText; | ||
| --spectrum-checkbox-text-color-error-hover: FieldText; | ||
|
|
||
| &.is-invalid { | ||
|
Member
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'd prefer if we can only override variables and not re-define selectors if possible. I think most of this seems unnecessary because the vars are already overridden above?
Member
Author
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. The variables as defined assume the same border colour for :checked. in lines 158-165 where the same colour is used for checked and unchecked.
Member
Author
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. @devongovett is that the direction you would like me to go? |
||
| .spectrum-Checkbox-box { | ||
| &:before { | ||
| border-color: var(--spectrum-checkbox-box-border-color); | ||
|
Member
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 conflicts with
Member
Author
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. It is intended to be ButtonText when unselected and Highlight when selected according to the XD |
||
| } | ||
| } | ||
| &.is-indeterminate .spectrum-Checkbox-box { | ||
| &:before { | ||
| border-color: var(--spectrum-checkbox-box-border-color-error); | ||
| } | ||
| } | ||
| &.is-disabled .spectrum-Checkbox-input:checked + .spectrum-Checkbox-box { | ||
| &:before { | ||
| border-color: GrayText; | ||
| } | ||
| } | ||
| /* Extra-specific selectors added here to handle checked state */ | ||
| .spectrum-Checkbox-input:checked + .spectrum-Checkbox-box | ||
| { | ||
| &:before { | ||
| border-color: var(--spectrum-checkbox-box-border-color-error); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
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.
Noticed the following when testing the Calendar/DateRangePicker WHCM. Lemme know if these are as expected due to color limitations or if they aren't/won't be handled in this PR:
vs
vs
vs
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.