matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Stylefmt forces @each after class extension #332

Open DavidStolk opened 6 years ago

DavidStolk commented 6 years ago

The problem is that we wan't to override the color of a group. But stylefmt forces the @each after the disabled class. We wan't:

.Button {
    @each $name, $props in $groups {
        &.#{$name} {
            background: lighten(map-get($props, 'color-dark'), 10%);
        }
    }

    &.disabled {
        background: $gray;
    }
}

But stylefmt wants:

.Button {
    &.disabled {
        background: $gray;
    }

    @each $name, $props in $groups {
        &.#{$name} {
            background: lighten(map-get($props, 'color-dark'), 10%);
        }
    }
}

We also don't wan't extend the group class with the disabled class as that will make a loads of unnecessary css lines. Not sure if this is an issue but we also don't wan't to be forced to use !important.