This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,17 +217,25 @@ $transition-timing-function: animation-variables.$standard-curve-timing-function
217217///
218218/// Returns a shadow or null if params are invalid.
219219/// @param {Number} $level - the level of the Material elevation system.
220- /// @param {String} $color [#000] - the color of the shadow.
220+ /// @param {String} $color - the color of the shadow.
221221/// @return {List|null} the complete box shadow or null.
222222///
223- @function _shadow ($level , $color : #000 ) {
224- @if $level == null or $level < 0 or $level > 24 {
225- @warn " $level must be between 0 and 24; received '#{$level } '" ;
223+ @function _shadow ($level , $color ) {
224+ @if $level == null and $color == null {
225+ // Do not emit a warning if both are null, which means the user did not
226+ // provide tokens.
227+ @return null;
228+ }
229+
230+ @if $level == null or $color == null {
231+ // If one of the tokens is null, emit a warning: the user may not realize
232+ // that both are required.
233+ @warn " both $level and $color are required; received $level: '#{$level } ', $color: '#{$color } '" ;
226234 @return null;
227235 }
228236
229- @if $color == null {
230- @warn " no $color provided ; received '#{$color } '" ;
237+ @if $level < 0 or $level > 24 {
238+ @warn " $level must be between 0 and 24 ; received '#{$level } '" ;
231239 @return null;
232240 }
233241
You can’t perform that action at this time.
0 commit comments