stylefmt
stylefmt copied to clipboard
Unnecessary Change Breaks CSS
I am having issues making this compatible with Lost.
The following property:
div {
lost-column: 1/2;
}
... is being formatted to:
div {
lost-column: 1 / 2;
}
Stylelint doesn't seem to throw any errors about this format, so why is stylefmt attempting to correct it?
@Braden1996 It's the default formatting rules of stylefmt. Is formatted code not be able to run with Lost?
Well, lost-column
has optional arguments which are space-separated. So, it seems to be passing three arguments (1
, /
and 2
) instead of just the one fraction argument (1/2
).
it even worst as it breaks SCSS variables names, like:
padding-bottom: $ratio-4-3;
into wrong:
padding-bottom: $ratio-4 - 3;
stylelint
have no problem with this line, why change it?
I would love to see this issue fixed! It makes it hard to use stylefmt and lost.
@pattiereaves Great! Please feel free to send your PR :)
:P well played @morishitter
Is #70 related?
There's some comments removed in that change, which say
// don't format minus sign (-) before a number
// because we don't know if it is
// part of a Sass variable name (e.g. $my-var-1-2).