# stylus/pythonic
enforces pythonic or brace style.
- ⚙️ This rule is included in
"stylelint-plugin-stylus/standard"
. (options:"always"
) - 🔧 The fix option (opens new window) can automatically fix some of the problems reported by this rule.
# 📖 Rule Details
This rule enforces pythonic or brace style.
# 🔧 Options
{
"stylus/pythonic": ["always" | "never",
{
"atblock": "always" | "never"
}
]
}
Primary Option
"always"
... Requires pythonic style (i.e. indentation-based)."never"
... Requires brace style.
Secondary Option (optional)
"atblock"
... Define the style to apply with @block (opens new window).
# "always"
// ✓ GOOD
.foo
color: red;
bar =
width: 20px;
height: 20px;
// ✗ BAD
.foo {
color: red;
}
bar = @block {
width: 20px;
height: 20px;
}
# "never"
// ✓ GOOD
.foo {
color: red;
}
bar = @block {
width: 20px;
height: 20px;
}
// ✗ BAD
.foo
color: red;
bar =
width: 20px;
height: 20px;
# [ "always", { "atblock": "never" } ]
// ✓ GOOD
.foo
color: red;
bar = @block {
width: 20px;
height: 20px;
}
// ✗ BAD
.foo {
color: red;
}
bar =
width: 20px;
height: 20px;
# [ "never", { "atblock": "always" } ]
// ✓ GOOD
.foo {
color: red;
}
bar =
width: 20px;
height: 20px;
// ✗ BAD
.foo
color: red;
bar = @block {
width: 20px;
height: 20px;
}
# 📚 Further reading
- Stylus - SELECTORS - Indentation (opens new window)
- Stylus - Features (opens new window)
- Stylus - @BLOCK (opens new window)