[mdc-dialog] [mdc-card] Inconsistent or unclear import/use, namespace, and mixin instructions
See original GitHub issueYour Environment:
"@material/button": "^5.1.0",
"@material/dialog": "^5.1.0",
OS: Ubuntu 18.04 Build Environment: dart-sass, webpack, webpack dart sass loader
I was unclear, on the instructions in the mdc card readme, how to use a mixin. A helpful person pointed out that, though it isn’t noted in the documents, to use the mixins listed in the table, you must do the following:
@use "@material/card/mdc-card"; // generates classes for .mdc-card
@use "@material/card"; // does not generate classes, is used to access mixins and variables
div {
// The prefix for @use "@material/card" is `card`
@include card.fill-color(#DADCE0);
}
I’d like to use the excellent mixins that are allegedly provided for the dialog
package.
So, I try
@use "@material/dialog/mdc-dialog";
@use "@material/dialog";
But, I get the following error:
SassError: Can't find stylesheet to import.
Hm. How can I use the dialog mixins?
Further information can be found at the following issue, which is now closed, so I hope it’s ok to open a new one: https://github.com/material-components/material-components-web/issues/5708
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This sounds like you’re using
sass-loader
. I just tried compiling my example Sass and it worked for me.With
sass-loader
you needwebpackImporter: false
as described in https://github.com/webpack-contrib/sass-loader/issues/804#issuecomment-586095020