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

css - scss - how to only import @use 'variables' in main file, not in all files - Stack Overflow

programmeradmin0浏览0评论

So, not sure if i'm looking in the right direction, but trying to use the latest sass, i'd like to replace my @import's with @use's like a good boy. Let's say my folder structure is this:

styles/
├─ main.scss
├─ _variables.scss
├─ components/
│  ├─ checkbox.scss
│  ├─ input.scss
│  ├─ radio.scss

and then in my main.scss I wanna do this:

@use "variables" as *;

@use "components/checkbox";
@use "components/radio";
@use "components/input";

and in my checkbox.scss, radio.scss, and input.scss i want to use those variables without declaring @use "variables" again in each file.

Is this possible? Because this won't work out of the box i think :(

发布评论

评论列表(0)

  1. 暂无评论