Skip to content

Commit

Permalink
fix(theme): ensure either() works with false values
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 355036766
  • Loading branch information
asyncLiz authored and copybara-github committed Feb 1, 2021
1 parent fec7b42 commit 8e66dbf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/mdc-theme/_tools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
// THE SOFTWARE.
//

/// Returns either the first provided value if it is truthy, or the second
/// value if not.
/// Returns either the first provided value if it is not null, or the second
/// value if the first is null.
///
/// @example scss
/// $value: either(map.get($theme, key), 1rem);
///
/// @param {*} $first - The first value to use if the first value is truthy.
/// @param {*} $second - The second value to use if the first value is falsy.
/// @param {*} $first - The first value to use, if it is not null.
/// @param {*} $second - The second value to use if the first value is null.
/// @return Either the first or the second value.
@function either($first, $second) {
@return if($first, $first, $second);
@return if($first != null, $first, $second);
}

0 comments on commit 8e66dbf

Please sign in to comment.