Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 8e66dbf

Browse files
asyncLizcopybara-github
authored andcommitted
fix(theme): ensure either() works with false values
PiperOrigin-RevId: 355036766
1 parent fec7b42 commit 8e66dbf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/mdc-theme/_tools.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
// THE SOFTWARE.
2121
//
2222

23-
/// Returns either the first provided value if it is truthy, or the second
24-
/// value if not.
23+
/// Returns either the first provided value if it is not null, or the second
24+
/// value if the first is null.
2525
///
2626
/// @example scss
2727
/// $value: either(map.get($theme, key), 1rem);
2828
///
29-
/// @param {*} $first - The first value to use if the first value is truthy.
30-
/// @param {*} $second - The second value to use if the first value is falsy.
29+
/// @param {*} $first - The first value to use, if it is not null.
30+
/// @param {*} $second - The second value to use if the first value is null.
3131
/// @return Either the first or the second value.
3232
@function either($first, $second) {
33-
@return if($first, $first, $second);
33+
@return if($first != null, $first, $second);
3434
}

0 commit comments

Comments
 (0)