DNReNTi
DNReNTi

Reputation: 521

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!

Upvotes: 1

Views: 1357

Answers (3)

Mad Dog Cadogen
Mad Dog Cadogen

Reputation: 667

For PhpStorm I solved this with:

  1. In the project browser, right click on the .css file that you'd like to ignore.
  2. Go to "Override file type".
  3. 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.

enter image description here enter image description here

Upvotes: 0

DNReNTi
DNReNTi

Reputation: 521

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.

Upvotes: 0

LazyOne
LazyOne

Reputation: 165268

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.

Upvotes: 1

Related Questions