0
votes

How can I enable recognizing and highlighting of PHP-code in CSS files in PhpStorm?

The files are named *.css and not *.php. I cannot change them (restriction/dependency on the environment/framework).

I'm aware of the possibilities of Highlighting js-code inside php file, but this requires the extension to be php which isn't possible.

1
So ... change extension to complex one: *.php.css and register to PHP files in Settings | File Types; then -- as described in that link for js files. PhpStorm has to recognize such files as PHP ones in order to have PHP highlighting, and the only way of doing this is to assign some pattern to "PHP files" (can be file extension(s), can be full file name etc) - LazyOne

1 Answers

4
votes

Just assign CSS extension to php file type and then set the "outer" language to CSS at Settings/Template Language for all those files.