sass - How can I implement @use with layer()? - Stack Overflow

admin2025-04-20  0

In CSS, @import "typography" layer(typography) will scope an import to that cascade layer.

However, in Sass @import is deprecated, and according to this Sass issue, it doesn't seem like the plan is to support layer() function for @use.

Is there an equivalent way to attach imported @use styles to a cascade layer?

Neither of these solutions currently work:

@use 'typography' layer(typography)

@layer typography { 
  @use 'typography';
}

The only way seems to be modifying the file being imported to wrap everything in a layer, which is an option in some cases but not if it's an external library.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745084673a284065.html

最新回复(0)