diff --git a/src/material/core/style/_sass-utils.scss b/src/material/core/style/_sass-utils.scss index 413d341bd6a7..e944be17610e 100644 --- a/src/material/core/style/_sass-utils.scss +++ b/src/material/core/style/_sass-utils.scss @@ -10,9 +10,14 @@ /// @content Content to output under the current selector, or root selector if there is no current /// selector. @mixin current-selector-or-root($root: html) { - @at-root #{& or $root} { + @if & { @content; } + @else { + #{$root} { + @content; + } + } } /// A version of the standard `map.merge` function that takes a variable number of arguments.