vscode-colorize
vscode-colorize copied to clipboard
variables in separate file
Hi, please, is it possible to highlight variables, which are configured in other .less file in same dir? Thanks.
It should work by default. You only have to enable less variables support in your user setting. See https://github.com/KamiKillertO/vscode-colorize/blob/develop/README.md#colorizecolorized_variables
@mino182 does it solve your problem?
@KamiKillertO I realize that it work after I make any change in file. When I only open files, colorize doesn't work. example: I open variables.less and only css color values are highlighted. Then I type anywhere anything and variables get color backgrounds. Then I open styles.less and everything works (variables from variables.less are hightlighted). But if I open both files at same time I need to first make change in variables.less, then make change in styles.less and after that variables get background.
Can you send me some screenshots or videos? I'll try to reproduce your issue. Sorry for the inconveniences
Here is video: https://youtu.be/2GnFi7-kQHs
Thanks.
Sorry for the late answer. I think I've understand your problem. You're opening the files one by one and not a folder so that's why it's not working properly. By default when your open vscode my addon fetch all files in your current project and search for variables. In your case there's no projet/folder so that's why it's not searching variables. I'll try to improve the current behavior to improve the experience with single files
Not to hijack this ticket, but I think I'm having a similar issue as the OP.
In my project, we have a few different .scss
files that hold all of our generated variables. Colorize seems to read these declarations without issue:
However, when I try to use one of these variables (specifically the Sass variable) in another part of my project, Colorize isn't applied even though Intellisense sees the variable and can find the source:
When I add the equivalent rgba()
value to it, Colorize kicks in fine:
I have both CSS and SASS listed in the colorize.colorized_variables
array. Is there something I'm missing? Thanks @KamiKillertO!