最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览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.

发布评论

评论列表(0)

  1. 暂无评论