Skip to content
Advertisement

PhpStorm marking used CSS selectors as unused

I wanted to use PHP in my CSS so I changed the file extension of my .css file to .php and instead of using <link> I used require_once to include it into my other file. Now PhpStorm sees the selector in my CSS as “unused” even though everything is working fine and the CSS is applied.

Is there any way to make PhpStorm realise the selector is actually used? Or if that’s not possible, can I at least turn the warning off?

Advertisement

Answer

You might want mark your directories as Resource Root from the context menus on Project window.

You can turn that inspection off from

[Top Menu]

File -> Settings

[Left Pane]

Editor -> Inspections

[Right Pane]

CSS -> Unused CSS selector

by unchecking the box next to it.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement