Skip to content

Commit

Permalink
feat(switch): add warning for handle-height and handle-width whic…
Browse files Browse the repository at this point in the history
…h are not yet implmented.

PiperOrigin-RevId: 467226388
  • Loading branch information
material-web-copybara authored and copybara-github committed Aug 12, 2022
1 parent e2e2c9d commit e2f3c28
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions switch/lib/_switch-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,23 @@ $_forced-colors-theme: (
@return $theme;
}

@function _warn-of-not-implemented($theme) {
// TODO(b/230484095): remove this warning once these are implemented.
@if (
map.has-key($theme, selected-handle-height) or
map.has-key($theme, selected-handle-width) or
map.has-key($theme, unselected-handle-height) or
map.has-key($theme, unselected-handle-width) or
map.has-key($theme, pressed-handle-height) or
map.has-key($theme, pressed-handle-width)
) {
@warn '`handle-height` and `handle-width` are not yet implemented. see b/230484095';
}
@return $theme;
}

@mixin theme($theme, $resolvers: resolvers.$material) {
$theme: _warn-of-not-implemented($theme);
$theme: theme.validate-theme($light-theme, $theme);
$theme: _resolve-theme($theme, $resolvers);
$theme: theme.create-theme-vars($theme, switch);
Expand All @@ -123,6 +139,7 @@ $_forced-colors-theme: (
}

@mixin theme-styles($theme, $resolvers: resolvers.$material) {
$theme: _warn-of-not-implemented($theme);
$theme: theme.validate-theme-styles($light-theme, $theme);
$theme: _resolve-theme($theme, $resolvers);
$theme: theme.create-theme-vars($theme, switch);
Expand Down

0 comments on commit e2f3c28

Please sign in to comment.