vscode-colorize icon indicating copy to clipboard operation
vscode-colorize copied to clipboard

variables in separate file

Open mino182 opened this issue 6 years ago • 7 comments

Hi, please, is it possible to highlight variables, which are configured in other .less file in same dir? Thanks.

mino182 avatar Aug 28 '18 18:08 mino182

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

KamiKillertO avatar Aug 28 '18 21:08 KamiKillertO

@mino182 does it solve your problem?

KamiKillertO avatar Aug 30 '18 14:08 KamiKillertO

@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.

mino182 avatar Aug 30 '18 15:08 mino182

Can you send me some screenshots or videos? I'll try to reproduce your issue. Sorry for the inconveniences

KamiKillertO avatar Aug 30 '18 15:08 KamiKillertO

Here is video: https://youtu.be/2GnFi7-kQHs

Thanks.

mino182 avatar Aug 30 '18 15:08 mino182

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

KamiKillertO avatar Sep 05 '18 07:09 KamiKillertO

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: Screen Shot 2019-11-06 at 11 07 29 AM

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: Screen Shot 2019-11-06 at 10 55 28 AM Screen Shot 2019-11-06 at 10 55 37 AM

When I add the equivalent rgba() value to it, Colorize kicks in fine: Screen Shot 2019-11-06 at 10 55 57 AM

I have both CSS and SASS listed in the colorize.colorized_variables array. Is there something I'm missing? Thanks @KamiKillertO!

alexiscordova avatar Nov 06 '19 19:11 alexiscordova