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.
Just assign CSS extension to php file type and then set the "outer" language to CSS at Settings/Template Language for all those files.
Related
I have plenty of scss file in my MVC project.All of them imported to a single scss file then compile to a MainStyle.css. Inspect element just show css line and css file name.
Now when I want to change any style its not possible to find that scss file name in inspect element.
In addition show original sources in explorer not work.
You can enable source mapping when compiling from scss to css. You can check this article on that: https://www.sitepoint.com/using-source-maps-debug-sass-chrome/
Quick fix: You can go to the css line and copy the classname. Do a global search of wherever the classname is used. You should see the scss file along with what you're looking for
When working with Sass for Materialize and wanting to add my own .scss code to a project is it a better practice to directly modify the existing .scss files within the project, or to create your own separate .scss files, compile them to a different .css and refer to it at a later point in an HTML file to override the existing styles?
I would suggest never overwrite the classes of any library's .css or .sccs file if you are using some library like materialize or bootstrap.
Always create your own custom classes and use your CSS to modify the layout. Use your own CSS selectors while writing classes.
I use Sublime text 3 and installed plugins Sass, Syntax Highlighting for Sass, CSS Completions and CSS Extended Completions, but when I work with .scss, there aren't any auto-complete options for CSS keywords.
I followed this post, where isn't mentioned auto-complete functionality and this post, where is mentioned only emmet.
Anybody knows how to add sass auto-complete to sublime text 3?
The problem that you are likely running into is that Sublime is loading your .scss file with Sass syntax. The Sass syntax is a bit different than SCSS (they did away with the curly braces and semi-colons. If you go to this link you can see the difference between the two). To get your .scss files working you will need the SCSS plugin. Install it and set the syntax to SCSS and the auto-complete should start working for you.
I don't know why my filewatcher doesn't transpile certain scss files. I wanted to rename files that already existed to use them as partials. That worked fine for most of them but i couldn't rename all of them. When I tried to use "refactor->rename" there was a warning that the files would be used by another script but that was definitly not the case. I was not able to rename them in phpStorm so i renamed them in the directory manually. That worked but now no css files are created anymore. I tried to synchronize but that didn't help. My settings seems to be correct (see picture). Anyone had the same problem before and knows the solution?
When "Track only root files" option is on, the content of partials is merged into a single .css files when transpiling, so that a single css is generated instead of creating a separate css for each partial
According to this website. It said that sass will generate css file which is css3
so,here is my concern,what if the browser is not compatible with css3 file.
can I generate css2 file?
SASS is simply an alternative syntax for writing CSS which is then compiled into the standard CSS syntax. This means that your output CSS file will only contain CSS3 properties if you decide to use those properties in your SASS file.