4

I'm just started playing with magento2 frontend dev tools so I'm wondering if there is some configuration we can make in order to help PhpStorm to resolve the less variables like colours, sizes etc.

I'm talking about that:

enter image description here

I also found some missing definitions in that case:

enter image description here

Maybe I'm wrong and PhpStorm Isn't the right tool to work with less in magento, so if someone have any suggestion about another tool to use, we'll be appreciated too.

2 Answers 2

2

Possible Workaround:

I found a way to:

  1. Remove errors highlighting
  2. Remove some definitions duplications

To remove highlighting:

Preferences > Editor > Inspections > Less

Uncheck all warns (I'm not sure if it's correct):

enter image description here

To Remove Definitions Duplications:

I've just excluded lib/web/less

enter image description here

Now I can see suggestions for .lib* and @color-* or @wherever-* definitions.

I'll leave the question open for a few days just in case anyone give me a better solution.

0

This can happen when you mark the magento2 "lib" directory as excluded. Marking this directory as "not excluded" makes PhPstorm use the directory again as a reference for less variables under the app directory.

Also check that the scope is well set where Phpstorm looks for the reference. Select the variable in the less file and press alt+enter (windows) and you will get options to check or set the reference scope.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.