'Navigate to SASS class instead of CSS from HTML in PhpStorm?
Is there any way to make JetBrains PhpStortm (v8) to navigate to the SASS file when I Ctrl+cilck on a CSS class/id in the HTML source, insted of the default (to the CSS file class/id) setting? It would be great, and I cant find a soloution. Thanks in advance!
Solution 1:[1]
I found a half-solution! If I link the scss file in the head, then I can select the SASS declaration. Yay! :D
<link href="/css/sass/main.scss">
Thats work for me.
Solution 2:[2]
It's not really supported:
Please star/vote/comment to get notified on progress.
Although I have to say that in LESS it's kind of works for simple classes/ids (not made from parts via &
or multi-level ones): it asks to which declaration to go and offers me 2 files: file.css or file.less.
Solution 3:[3]
For PhpStorm I solved this with:
- In the project browser, right click on the .css file that you'd like to ignore.
- Go to "Override file type".
- Select "Plain text".
Now when you command click a style it will navigate directly to the .scss file and NOT the .css file. The .css file will be read by the browser but ignored by PhpStorm.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | DNReNTi |
Solution 2 | LazyOne |
Solution 3 | Mad Dog Cadogen |