Empty Style (.CSS/.Scss) Files

Empty style (.css/.scss) files

For me, you can let the CSS / SCSS files empty.
Just because after the build everything around styling will be minified and contained the "styles.js" file.
So, even if it's a bit ugly to see all these empty files in dev mode, the compiler will solve your probelm by itself

this is a screen of your project after build :

Sample Image

Empty CSS/SCSS files and do Angular problems occur?

As far as I can tell from looking into this, the best answer is to just leave it. The compiler will indeed handle the empty files appropriately.

SonarQube is just picking it up as code smell, empty files should probably be removed to keep a project in its least complex state possible. In the example you gave with a company going through that many files it is a complete waste of time.

Empty CSS File Output When Converting SASS to CSS Using GruntJS

Finally, after several trials. I realized that no need to convert the mixins.scss. Because it's already converted automatically. So I change the src: 'sass/*.scss' to src: 'sass/styles.scss', and it finally works. Here's the output of converted css file:

.adi-class {
width: 100px;
height: 80px;
background: #008B8B; }
.adi-class a {
color: "blue"; }
.adi-class a:visited {
color: "red"; }
.adi-class a:hover {
color: "yellow"; }
.adi-class a:active {
color: "green"; }
.adi-class p {
color: #FF00FF; }

Gulp 4 compilling scss creates empty css file, but sass compiles correctly

Resolved: It turns out that only style block that had some property was commented, thus causing .scss file return empty output, and sass won't compile empty blocks.

Will sass include empty style blocks in its compiled output?

No, they aren't included in the compiled css file. This code would output nothing in the CSS file.

Sample Image

VSCode: How do I KEEP blank lines (in scss files or others)?

For example, in my .scss file, I want to keep the blank lines that I made in between nested styles

You can tryout the extension Beautify

  • Download it through VSCode's Extensions Manager.
  • Once installed, from the top menu select Go -> Go to File...
  • In the command line type, >b
  • You should then see an command for Beautify File
  • Click it. It should format your opened .SCSS file and preserve the blank spaces between each CSS rule set (if they were there already).

Laravel Mix suddenly stopped compiling SCSS and writes empty files

It seems that there is some general and known issues when you have async loaded files/components in your application code.

This clearly shows upstream issues further down in the open issue

For you now you could try to remove your dynamic imports, some developers also got it to work if you import an empty .css file in to your javascript file.



Related Topics



Leave a reply



Submit