Skip to content

Sort order for @each, @if and similars doesn't work #534

@celsomtrindade

Description

@celsomtrindade

I'm not able to include the sass code of type @each, @if (and similars) to the sort option.

They get ignored and move the code, messing up with the functions and mixins. This is my sort configuration:

"sort-order": [
    "$variable",
    "$extend",
    "$include",
    "@each",
    "align-items",
    "align-self",
    // more options...
]

This is an example of the code I'm having problems with:

@mixin transition($collection) {
    $string: null;
    
    @if ($collection == null) {
        $string: $_option-collection;
    } @else {
        $string: $collection;
    }
    
    transition: $string $time ease-in-out;
}

After compiling, the code changes to this:

@mixin transition($collection) {
    $string: null;
    transition: $string $time ease-in-out;
    
    @if ($collection == null) {
        $string: $_option-collection;
    } @else {
        $string: $collection;
    }
}

It doesn't work only for the code starting with @, the others work just fine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions