Skip to content

Commit

Permalink
zu: Fix switch disable state error
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Nov 23, 2023
1 parent b86f6c9 commit 8c8d148
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
5 changes: 3 additions & 2 deletions crates/zu/src/switch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ pub fn switch(props: &Props) -> Html {
aria_label={&props.aria_label}
classes={base_cls}
checked={props.checked}
checked_icon={icon.clone()}
default_checked={props.default_checked}
disabled={props.disabled}
input_classes={base_input_cls}
icon={icon.clone()}
icon={icon}
on_change={props.on_change.clone()}
checked_icon={icon}
variant={Variant::Switch}
>
</SwitchBase>
Expand Down
48 changes: 24 additions & 24 deletions crates/zu/src/switch/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@
background-color: transparent;
}
}
}

&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-primary-main;
&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-primary-main;
}
}

&.ZuSwitchBase-checked + .ZuSwitch-track {
Expand All @@ -187,11 +187,11 @@
background-color: transparent;
}
}
}

&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-secondary-main;
&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-secondary-main;
}
}

&.ZuSwitchBase-checked + .ZuSwitch-track {
Expand All @@ -212,11 +212,11 @@
background-color: transparent;
}
}
}

&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-success-main;
&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-success-main;
}
}

&.ZuSwitchBase-checked + .ZuSwitch-track {
Expand All @@ -237,11 +237,11 @@
background-color: transparent;
}
}
}

&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-info-main;
&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-info-main;
}
}

&.ZuSwitchBase-checked + .ZuSwitch-track {
Expand All @@ -262,11 +262,11 @@
background-color: transparent;
}
}
}

&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-warning-main;
&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-warning-main;
}
}

&.ZuSwitchBase-checked + .ZuSwitch-track {
Expand All @@ -287,11 +287,11 @@
background-color: transparent;
}
}
}

&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-error-main;
&.ZuSwitchBase-disabled {
// TODO(Shaohua): call lighten() for light theme.
color: $zu-palette-error-main;
}
}

&.ZuSwitchBase-checked + .ZuSwitch-track {
Expand Down

0 comments on commit 8c8d148

Please sign in to comment.