gencer / SCSS-Everywhere

A Visual Studio Code extension that provides CSS class and ID atttribute completion with incremental build and usage explorer for the HTML class attribute based on the CSS/Template files in your workspace. Also supports React's className attribute.
https://marketplace.visualstudio.com/items?itemName=gencer.html-slim-scss-css-class-completion
MIT License
24 stars 9 forks source link

Support for generated classes in SCSS #46

Open alvaromartmart opened 5 years ago

alvaromartmart commented 5 years ago

Would it be possible to support auto-completion of classes generated by SCSS as in this example?

$colors:(
    main: #FAEEBA,
    secondary: #FEAABE
)

@each $colorName, $colorValue in $colors {
  .text-#{$colorName}{
    color: $colorValue;
  }
}

This will generate classes text-main and text-secondary, which the extension would need to cache and auto-complete.

Is this possible?

gencer commented 5 years ago

Unfortunately, this is beyond of this extension. We only parse static variables. This is dynamic generated on compile time. Therefore, this need to be first compiled to css then cached to VSCode. This will add a huge overhead to the compilation time.

I'm thinking If I could make it via SCSS Parsers but this is not possible anytime soon.

gencer commented 4 years ago

Hi! This issue re-opened by me. Reason is i want to add an extra option to users to allow them to compile SCSS into CSS before parsing. This will allow custom functions being seen by extension.

  1. You save the SCSS File
  2. VSCode triggers save and this extension rebuild all SCSS into CSS if its enabled
  3. Re-cache done automatically.
alvaromartmart commented 4 years ago

Great, thanks!