stylefmt
stylefmt copied to clipboard
Custom at-rules don't get formatted according to .stylelintrc.json
Given the following .stylelintrc.json
https://gist.github.com/chrishoage/bdedf025288486050fd60535bd018c3e
And the following CSS
.planButton {
@add-mixin truncate;
display: inline-block;
margin: 0 20px 20px;
width: 240px;
}
The output is this
.planButton {
@add-mixin truncate ;
display: inline-block;
margin: 0 20px 20px;
width: 240px;
}
One expects stylefmt
to not a) move the custom at-rule, and b) not add a space after truncate
.
I was playing around with formatAtRules
and the issue appears to be that formatAtRules
doesn't handle unknown at-rules very well.
Since PostCSS supports defining custom at-rules (postcss-mixins) stylefmt should respect custom at-rules and format them to the way postcss validates.