cmalven / vite-plugin-sass-glob-import

Use glob syntax for imports in your main Sass or SCSS file.
MIT License
18 stars 7 forks source link

Adding options to process meta.load-css with glob imports #20

Open LaTableRouge opened 3 weeks ago

LaTableRouge commented 3 weeks ago

An extension of this pull request

Given a directory structure like this one:

src
├── components
│   ├── cta
│   │   ├── brand1.scss
│   │   └── brand2.scss
│   ├── button
│   │   ├── brand1.scss
│   │   └── brand2.scss
…   …

And a glob pattern like that:

.cta {
 @include meta.load-css('components/cta/**/*.scss');
}

.button {
 @include meta.load-css('components/button/**/*.scss');
}

The output would be:

.cta {
 @include meta.load-css('components/cta/brand1.scss');
 @include meta.load-css('components/cta/brand2.scss');
}

.button {
  @include meta.load-css('components/button/brand1.scss');
  @include meta.load-css('components/button/brand2.scss');
}

This is my first pull request and I'm totally not familiar with Typescript and how the tests works! Please feel free to tell me if there's anything wrong so I may learn and correct it somehow.