Skip to content

Commit

Permalink
feat: add more detail to error message on sass color function.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 465587302
  • Loading branch information
material-web-copybara authored and copybara-github committed Aug 5, 2022
1 parent ee35bfe commit c293a8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sass/_color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ $_hex: '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' 'a' 'b' 'c' 'd' 'e' 'f';
/// CSS custom property for comma separated rgb color.
@function color-var-hex-to-rgba($var, $opacity) {
@if not var.is-var($var) {
@error '#{$var} is not a valid custom property.';
@error '"#{$var}" is not a valid custom property.';
}

@if meta.type-of($opacity) != 'number' {
@error '#{$opacity} is not a valid number.';
@error '"#{$opacity}" is not a valid number. Expecting to combine it with "#{$var}"';
}

$fallback: var.fallback($var);
Expand Down

0 comments on commit c293a8d

Please sign in to comment.