@extend css tag from module (@use)
See original GitHub issueI’m currently upgrading a scss project from @import to the new module system with @use. Everything is going great except for the @extend at-rule. I’m unable to find anything in the documentation on how to tell sass that the tag being extended comes from another module.
This does not work:
@use "./colors.scss" as colors;
body {
@extend .element; // not working
@extend colors, .element; // not working
}
Example: https://stackblitz.com/edit/angular-tufq7f?file=src%2Fstyles.scss
Is this an intentional breaking change? Is the solution missing from the official docs? Any suggestions are appreciated.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
The Extend Concept | CSS-Tricks
The Stylus Way. Stylus uses @extend and works largely similar to Sass. .module padding 10px h3 color red .news @extend .module. Outputs:
Read more >Sass: @extend
Sass's @extend rule solves this. It's written @extend <selector> , and it tells Sass that one selector should inherit the styles of another....
Read more >Sass extend class from module - Stack Overflow
This gives the following error: "body" failed to @extend ".element". The selector ".element" was not found. Use "@extend .element ...
Read more >CSS Modules by Example - JavaScript Stuff
CSS Modules are a means to achieve locally scoped CSS class names. ... In your component, you must put one class names on...
Read more >Sass @extend and Inheritance - W3Schools
By using the @extend directive, you do not need to specify several classes for an element in your HTML code, like this: <button...
Read more >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 code works when run directly with the latest version of Dart Sass.
It looks like you’re using a version of Sass that doesn’t support the module system. Please make sure you’re using Dart Sass 1.23.0 or later (libsass/Node Sass don’t support the module system)
No. Please see the documentation on extension scope