-3

I am getting an error while transpiling sass to css, "Line X: Inconsistent indentation: Y spaces were used for indentation, but the rest of the document was indented !Y spaces"

Here is the error state of my sass code:

header 
{
     margin: 50px;
     background-color: #2aa4df;

     div 
     {

     } 
       p 
       { 
           margin-top: 0;
       }
}

As you can see, near the p style rule I have used a different indentation which produces the error. What I'm wanting to know is why indention is important from a compiler perspective

Bobstar89
  • 27
  • 6

1 Answers1

4

Indentations errors are not related to sass transpiler, the sass transpiler never mind converting unindented source code. You can try this - https://www.sassmeister.com/ and paste your above code. It works perfectly without any error.

I think there is some css lint setting which is not allowing that indentation and due to that, you are getting those error. Please look for lint settings in your project.

Ashvin777
  • 1,446
  • 13
  • 19