Skip to content

Commit

Permalink
feat(theme): custom property fallback values are now optional
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 313249609
  • Loading branch information
asyncLiz authored and copybara-github committed May 26, 2020
1 parent fa25709 commit 01de070
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/mdc-theme/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@

@if is-var-with-fallback_($fallback) {
@return var(#{$var}, var_($fallback));
} @else {
} @else if $fallback != null {
@return var(#{$var}, $fallback);
} @else {
@return var(#{$var});
}
}

Expand All @@ -106,6 +108,10 @@
///
@function color-hash($color) {
@if is-var-with-fallback_($color) {
@if (map.get($color, "fallback") == null) {
@return map.get($color, "varname");
}

$color: map.get($color, "fallback");
}

Expand Down

0 comments on commit 01de070

Please sign in to comment.