admin管理员组

文章数量:1357639

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 :(

本文标签: cssscsshow to only import use 39variables39 in main filenot in all filesStack Overflow