I am using the Material Design Components for Web library. I have a tab component that I'd like to change the underline-color
of.
The instructions say
To customize the tab indicator, use the following mixins.
Then it gives a table. For underline color, it says
underline-color($color) Customizes the color of the underline.
So, I try in my scss
file, the following:
.mdc-tab-indicator {
underline-color(red);
}
I compile my sass (using dart-sass
) and get the following error
Error: expected "{".
It says this is a "Sass Mixin." So, I look at the SASS documentation on mixins. I see nothing that follows the syntax mixin-name($variable)
. Everything in there looks like
@mixin reset-list {
margin: 0;
}
with curly braces, not parentheses. But, the error said it was expecting a curly brace, and also apparently the @
symbol is required. So, I try:
.mdc-tab-indicator {
@underline-color(red);
}
This doesn't throw an error, but doesn't cause the underline color to change. I try to follow the syntax of the sass docs:
.mdc-tab-indicator {
@underline-color(red){};
}
No error, but no color change. I try to match the syntax better:
.mdc-tab-indicator {
@mixin underline-color(red){};
}
This throws
Error: expected ")".
I try
.mdc-tab-indicator {
@mixin underline-color(red);
}
Same error.
I don't understand what the material components documentation is instructing. What does it mean when it says "To customize the tab indicator, use the following mixins." ? How can I change the underline color of the Material Design Component tab indicator?