Skip to content

Commit

Permalink
<TODO>
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 566257686
  • Loading branch information
material-web-copybara authored and copybara-github committed Sep 19, 2023
1 parent a246a44 commit 29e2a57
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions packages/mdc-checkbox/_checkbox-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ $forced-colors-theme: (
}

@include ripple-color(
$color: map.get($theme, unselected-hover-state-layer-color),
$color-map: (
hover: map.get($theme, unselected-hover-state-layer-color),
focus: map.get($theme, unselected-focus-state-layer-color),
press: map.get($theme, unselected-pressed-state-layer-color),
),
$opacity-map: (
hover: map.get($theme, unselected-hover-state-layer-opacity),
focus: map.get($theme, unselected-focus-state-layer-opacity),
Expand Down Expand Up @@ -222,7 +226,9 @@ $light-theme-deprecated: (
}
@if $ripple-color {
@include ripple-color(
$color: $ripple-color,
$color-map: (
hover: $ripple-color,
),
$opacity-map: $ripple-opacity,
$query: $query
);
Expand Down Expand Up @@ -633,16 +639,32 @@ $light-theme-deprecated: (

/// Sets ripple color when checkbox is not in checked state.
@mixin ripple-color(
$color,
$color-map: null,
$opacity-map: null,
$query: feature-targeting.all()
) {
@include ripple-theme.states(
$color: $color,
$color: map.get($color-map, hover),
$opacity-map: $opacity-map,
$query: $query,
$ripple-target: $ripple-target
);

@if map.has-key($color-map, focus) {
@include ripple-theme.states-activated(
$color: map.get($color-map, focus),
$query: $query,
$ripple-target: $ripple-target
);
}

@if map.has-key($color-map, press) {
@include ripple-theme.states-selected(
$color: map.get($color-map, press),
$query: $query,
$ripple-target: $ripple-target
);
}
}

/// Sets focus indicator color when checkbox is in checked state.
Expand Down Expand Up @@ -703,7 +725,9 @@ $light-theme-deprecated: (
/// @access private
///
@mixin if-unmarked-enabled_ {
.mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate):not([data-indeterminate='true'])
.mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate):not(
[data-indeterminate='true']
)
~ {
@content;
}
Expand All @@ -718,7 +742,9 @@ $light-theme-deprecated: (
// Note: we must use `[disabled]` instead of `:disabled` below because Edge does not always recalculate the style
// property when the `:disabled` pseudo-class is followed by a sibling combinator. See:
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11295231/
.mdc-checkbox__native-control[disabled]:not(:checked):not(:indeterminate):not([data-indeterminate='true'])
.mdc-checkbox__native-control[disabled]:not(:checked):not(:indeterminate):not(
[data-indeterminate='true']
)
~ {
@content;
}
Expand Down

0 comments on commit 29e2a57

Please sign in to comment.