Rule brace-style
will enforce the use of the chosen brace style.
style
:'1tbs'
,'stroustrup'
,'allman'
(defaults to1tbs
)allow-single-line
:true
/false
(defaults totrue
)
When style: '1tbs'
or style: 'stroustrup'
, the following are allowed. When style: 'allman'
the following are disallowed:
.foo {
content: 'foo';
}
.foo,
.bar {
content: 'bar';
}
@function foo() {
@return 'foo';
}
@mixin bar() {
content: 'bar';
}
When style: 'allman'
, the following are allowed. When style: '1tbs'
or style: 'stroustrup'
, the following are disallowed:
.foo
{
content: 'foo';
}
.foo,
.bar
{
content: 'bar';
}
@function foo()
{
@return 'foo';
}
@mixin bar()
{
content: 'bar';
}
When style: '1tbs'
, the following are allowed. When style: 'stroustrup'
or style: 'allman'
, the following are disallowed:
@if ($foo) {
$bar: 'bar';
} @else {
$bar: false;
}
When style: 'stroustrup'
, the following are allowed. When style: '1tbs'
or style: 'stroustrup'
, the following are disallowed:
@if ($foo) {
$bar: 'bar';
}
@else {
$bar: false;
}
When allow-single-line: true
, the following are allowed. When allow-single-line: false
, the following are disallowed:
.foo { content: 'foo'; }
.foo, .bar { content: 'bar'; }
@if ($foo) { $bar: 'foo'; }
// Allowed with style: '1tbs', disallowed with style: 'stroustrup' or style: 'allman'
@if ($foo) { $bar: 'foo'; } @else { $bar: false; }
// Allowed with style: 'stroustrup' or style: 'allman', disallowed with style: '1tbs'
@if ($foo) { $bar: 'foo'; }
@else { $bar: false; }