Skip to content

Property: injectGlobalPaths doesn't take into account @use rules #70

Open
@lennu

Description

@lennu

Lets say I have the following setup:

{
  injectGlobalPaths: ['./mixins.scss']
}
### mixins.scss
@mixin whatever {
  margin: 0;
}
### styles.scss
use "sass:math";

div {
  width: math.div(100, 2);
}

This will end up with error: @use rules must be written before any other rules.
https://sass-lang.com/documentation/at-rules/use

The code which adds the import statements, should analyze the file and add import clauses under @use statements instead of just adding them to beginning of the each file.
https://github.com/ionic-team/stencil-sass/blob/7871073e3a882af4bf9a8fc7bf4faf6092828ee4/src/util.ts#L55

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions