-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat(checkbox): update component specs #846
Conversation
Deploy preview for helix-ui ready! Built with commit 2538b24 |
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.
DEV LGTM
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.
@100stacks been a while since I looked at these inner helix component files. So I had some questions around understanding some of the redundant fallback properties. I think I also found a couple of small changes. We can zoom over these changes. It would probably help me start catching up on understanding how far all of this code has evolved. thanks.
background-color: var(--hxCheckbox-bgcolor, $gray-0); | ||
border-radius: 2px; | ||
border: $gray-500; | ||
border: 1px solid var(--hxCheckbox-border, $gray-500); |
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.
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.
Good catch. I'll fix this.
box-shadow: $focus-glow-invalid; | ||
} | ||
@else if $pseudo-state == hover { | ||
background-color: $red-status-100; | ||
background-color: var(--hxCheckbox-invalid-hover-bgcolor, $red-status-100); |
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.
For the Required state. I agree that this is a rare use case, but is certainly possible in our BPiT forms within CTUI.
Double check with design and confirm the specs with them for the hover background color and the entire state in general. I assume it would just stay the same, but they would need to include this state in their documentation. Seems like it was missed in the design.
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.
@danielmdesigns, can you provide design recommendations for required
and invalid
states. These states could occur during validation phase (for example, form validation).
@@ -153,7 +153,7 @@ $font-monospace: "Open Sans Condensed", "Roboto Mono", monospace; | |||
// ==== FOCUS STATE ===== | |||
$focus-glow: 0 0 4px rgba($blue-700, 0.5); | |||
$focus-glow-disabled: $focus-glow; | |||
$focus-glow-invalid: 0 0 4px rgba($red-status-900, 0.5); | |||
$focus-glow-invalid: 0 0 4px rgba($red-status-500, 0.5); |
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.
This looks good to me. However, just make sure design includes this in their docs.
The focus states were left out of the checkbox states and missed. I think they were missed for radios and some other components as well.
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.
@danielmdesigns, can you provide design recommendations for required
and invalid
states. These states could occur during validation phase (for example, form validation).
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.
@ssalinas24 @danielmdesigns we received confirmation from design to keep required
and invalid
states. I updated these states to match our v2.0 Checkbox component styled specifications.
background-color: var(--hxCheckbox-bgcolor, $gray-0); | ||
border-radius: 2px; | ||
border: $gray-500; |
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.
this line is a border short hand with just the color var. The line 86 below it with $gray-500 color already establishes a color var at the end of that line and size. Is line 86 in parenthisis conditional to have CSS VAR || Color Var? If so then I guess you wouldn't need this line 85. If not, then this line 85 would be same as line 86 but with only the color var, right? and line 86 would just have the CSS var, correct?
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.
Good catch. I'll verify which property is correct and update.
color: var(--hxCheckbox-indeterminate-color, $blue-700); | ||
|
||
~ label > hx-checkbox { | ||
background-color: $blue-700; |
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.
@100stacks so i'm just asking in order to gain knowledge. I see we sometimes duplicate properties. So in this case we have the color variable here, and then the next line we have the same property, but with the CSS variable. This is required for browser compatibility and fallback, correct? So if the browser doesn't support CSS variables, then it will at least have the usual color var, correct?
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.
@ssalinas24, yes that's correct. We're using duplicate properties for IE11 support fallback. It's cleaner and simpler than using a library to provide polyfills for IE11 CSS variables/custom property support.
} | ||
} | ||
|
||
&:valid { | ||
~ label > hx-checkbox:hover { | ||
@include hxCheckboxFacade($pseudo-state: hover); | ||
@include hxCheckboxFacade($pseudo-state: null); // v2.0 specs |
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.
we didn't still need the hover here? I guess because hover technically is supposed to look the same as the checked state, correct?
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.
Yes, we need clarification from design on hover
while the checkbox is checked
/selected
state.
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.
@danielmdesigns, can you please provide design recommendations for hover
state on a checked
/selected
checkbox.
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.
@ssalinas24, I'm leaving the hover state construct in place for now.
|
||
// ========== PRISTINE ========== | ||
@mixin __checkboxControl($pseudo-state: null) { | ||
@if $pseudo-state == focus { | ||
box-shadow: $focus-glow; | ||
// box-shadow: $focus-glow; // TBD v2.0 specs |
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.
So has designed confirmed that we are just getting rid of the box-shadow for all focus states on every element?
If we have them on some elements, but not others, then that is inconsistent. Let me know if they have a made a decision.
border-color: var(--hxCheckbox-bordercolor-focus, $blue-900); | ||
box-shadow: $focus-glow; | ||
// box-shadow: $focus-glow; // TBD v2.0 specs |
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.
again let me know if we have a straight answer around box shadows across the design system
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.
Yes, I'll check with @danielmdesigns on his recommendations for checkbox.
@@ -38,21 +43,24 @@ | |||
box-shadow: $focus-glow-invalid; | |||
|
|||
&::-ms-check { | |||
border-color: var(--hxCheckbox-invalid-bordercolor, $red-status-900); | |||
border-color: $red-status-500; | |||
border-color: var(--hxCheckbox-invalid-bordercolor, $red-status-500); |
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.
similar setup here. Let me know if this is correct, and I'm just wrong in my prior comment in first file.
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.
That's right. This is our pattern to support IE11 fallbacks.
border-color: var(--hxCheckbox-disabled-bordercolor, $gray-500); | ||
box-shadow: $focus-glow-disabled; | ||
// box-shadow: $focus-glow-disabled; // TBD v2.0 specs |
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.
another box shadow area to confirm
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.
Yes, we need clarification from design on box shadow for checkbox.
76a7623
to
d27e3f8
Compare
d27e3f8
to
2538b24
Compare
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.
@ssalinas24, please see PR #846 updates.
} | ||
} | ||
|
||
&:valid { | ||
~ label > hx-checkbox:hover { | ||
@include hxCheckboxFacade($pseudo-state: hover); | ||
@include hxCheckboxFacade($pseudo-state: null); // v2.0 specs |
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.
@ssalinas24, I'm leaving the hover state construct in place for now.
@@ -153,7 +153,7 @@ $font-monospace: "Open Sans Condensed", "Roboto Mono", monospace; | |||
// ==== FOCUS STATE ===== | |||
$focus-glow: 0 0 4px rgba($blue-700, 0.5); | |||
$focus-glow-disabled: $focus-glow; | |||
$focus-glow-invalid: 0 0 4px rgba($red-status-900, 0.5); | |||
$focus-glow-invalid: 0 0 4px rgba($red-status-500, 0.5); |
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.
@ssalinas24 @danielmdesigns we received confirmation from design to keep required
and invalid
states. I updated these states to match our v2.0 Checkbox component styled specifications.
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.
LGTM
Description
Update Checkbox specs.
What are the relevant story cards/tickets? Any additional PRs or other references?
Jira: SURF-2182
Before you request a review for this PR:
yarn test
to ensure all tests passed?