atom-pigments icon indicating copy to clipboard operation
atom-pigments copied to clipboard

Local scope in less

Open fogrew opened this issue 9 years ago • 4 comments

In less does not work variables scoping Scoping variables

// sorry, i dont speak english

fogrew avatar Jul 20 '15 15:07 fogrew

As it's not a less parser it doesn't have any knowledge of how to handle scopes, imports, branches, etc. To solve this kind of problem it needs to be aware of the build process and the dependencies, which is clearly out of the scope of this package for the moment. Not sure I'll be able to fix that one day without having to load every preprocessors outthere and requiring every project to setup pigments to replicate the build process.

abe33 avatar Jul 20 '15 15:07 abe33

Oups, bad issue reference, and it looks like github didn't catched up with the last rebase.

abe33 avatar Jul 27 '15 19:07 abe33

Would it be feasible to instead just log where the pigments are applied and take the term before any ":" or "=" etc... and apply the pigment to that variable automatically. So on applying green above to #669b41 it sees the ":" and applies the same to @button-color directly without needing knowledge of the grammar of the file.

eboracus avatar Aug 02 '15 14:08 eboracus

@eboracus That sounds reasonable to me, and would avoid having to parse Less or SCSS.

marnen avatar Apr 01 '16 19:04 marnen