clinyong / vscode-css-modules

https://marketplace.visualstudio.com/items?itemName=clinyong.vscode-css-modules
MIT License
144 stars 39 forks source link

Support for nested classes (ampersand) #31

Open TuxGit opened 3 years ago

TuxGit commented 3 years ago

Add support for nested classes using with postcss, scss plugins.

Sometimes you need to separate the styles for the child container and add prefix for it.

Example

.root { ... }

.label {
    font-size: 1rem;

    &_primary {
        color: green;
    }

    &_sizeSmall {
        font-size: 0.875rem;
    }
}

Expected result autocomplete

styles.label
       label_primary
       label_sizeSmall    

P.S. This case works in WebStorm

saschati commented 1 year ago

Any news on this feature?

totodot commented 1 year ago

@clinyong any update?

inoyakaigor commented 1 year ago

Since CSS nesting came in all major browsers (in Firefox since 117 version /current Beta/) this issue became more and more important