Kriem
Kriem

Reputation: 8705

Sass compiler says: Inconsistent indentation

I have this in my main.sass:

#thing 
{
       -moz-box-sizing:     border-box; 
    -webkit-box-sizing:     border-box; 
            box-sizing:     border-box;
}

When compiling, sass says:

Inconsistent indentation: 7 spaces were used for indentation, 
but the rest of the document was indented using 4 spaces.

Is there a way to suppress this?

Upvotes: 10

Views: 11290

Answers (1)

kettlepot
kettlepot

Reputation: 11011

UPDATE: Seeing that you've included the curly braces in your question, I suggest that you try changing the file's extension from .sass to .scss. SCSS will probably ignore your indentation because it can tell which part goes where based on the curly braces.


SASS relies on indentation to tell where you're trying to apply your CSS, so it won't be able to validate it if it varies in every line. Try this instead:

.something
    -webkit-box-sizing: border-box 
    -moz-box-sizing:    border-box
    box-sizing:         border-box

Personally, I wouldn't even bother indenting border-box to make them all start at the same column, because it's too much work for too little gain. As an alternative, you could write a mixin to do it for you:

@mixin border-box
    -webkit-box-sizing: border-box
    -moz-box-sizing: border-box
    box-sizing: border-box

After defining it, you can include it directly:

.something
    @include border-box

Upvotes: 14

Related Questions