Skip to content

Commit

Permalink
fix(ld-toggle): update to match current design
Browse files Browse the repository at this point in the history
- Make both icons visible in disabled state
- Use neutral colors in disabled state
- Update icon color in disabled state
- Add e2e tests covering disabled invalid combinations
  • Loading branch information
borisdiakur authored and renet committed Nov 9, 2021
1 parent 3f0e35d commit 8a5b800
Show file tree
Hide file tree
Showing 45 changed files with 1,000 additions and 2,181 deletions.
1,852 changes: 354 additions & 1,498 deletions screenshot/builds/master.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
11 changes: 6 additions & 5 deletions src/liquid/components/ld-toggle/ld-toggle.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
--ld-toggle-checked-icon-start-col: var(--ld-col-neutral);
--ld-toggle-checked-icon-end-col: var(--ld-col-wht);
--ld-toggle-disabled-input-bg-col: var(--ld-col-neutral-050);
--ld-toggle-disabled-icon-col: var(--ld-col-neutral-600);
--ld-toggle-disabled-icon-col: var(--ld-col-neutral-200);
--ld-toggle-disabled-knob-bg-col: var(--ld-col-wht);
--ld-toggle-with-icons-input-bg-col: var(--ld-col-neutral-100);
--ld-toggle-with-icons-disabled-input-bg-col: var(--ld-col-neutral-050);

/* themable colors */
--ld-toggle-checked-bg-col: var(--ld-thm-primary);
--ld-toggle-checked-disabled-input-bg-col: var(--ld-thm-primary-alpha-low);
--ld-toggle-invalid-input-bg-col: var(--ld-thm-error);
--ld-toggle-invalid-knob-bg-col: var(--ld-thm-error);
--ld-toggle-with-icons-knob-col: var(--ld-thm-primary);
Expand Down Expand Up @@ -61,7 +60,7 @@

&:disabled,
&[aria-disabled='true'] {
background-color: var(--ld-toggle-checked-disabled-input-bg-col);
background-color: var(--ld-toggle-disabled-input-bg-col);
}

~ .ld-toggle__knob {
Expand All @@ -83,10 +82,12 @@
&[aria-disabled='true'] {
background-color: var(--ld-toggle-disabled-input-bg-col);

&:checked ~ .ld-toggle__icon-start {
&:checked ~ .ld-toggle__icon-start,
&:checked ~ .ld-toggle__icon-end {
color: var(--ld-toggle-disabled-icon-col);
}

&:not(:checked) ~ .ld-toggle__icon-start,
&:not(:checked) ~ .ld-toggle__icon-end {
color: var(--ld-toggle-disabled-icon-col);
}
Expand All @@ -105,7 +106,7 @@
z-index: 1;
}

input:invalid {
input:where(:not(:disabled):not([aria-disabled='true'])):invalid {
background-color: var(--ld-toggle-invalid-input-bg-col);
}
}
Expand Down
Loading

0 comments on commit 8a5b800

Please sign in to comment.