Place @else statements on the same line as the preceding curly brace.
Bad
@if {
...
}
@else {
...
}Good
@if {
...
} @else {
...
}This will ignore single line @if/@else blocks, so you can write:
@if { ... } @else { ... }You can prefer to enforce having @else on its own line by setting the style
configuration option to new_line.
| Configuration Option | Description |
|---|---|
style |
same_line or new_line (default same_line) |