matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Unnecessary Change Breaks CSS #195

Open Braden1996 opened 8 years ago

Braden1996 commented 8 years ago

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?

matype commented 8 years ago

@Braden1996 It's the default formatting rules of stylefmt. Is formatted code not be able to run with Lost?

Braden1996 commented 8 years ago

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).

tinovyatkin commented 8 years ago

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?

pattiereaves commented 7 years ago

I would love to see this issue fixed! It makes it hard to use stylefmt and lost.

matype commented 7 years ago

@pattiereaves Great! Please feel free to send your PR :)

pattiereaves commented 7 years ago

:P well played @morishitter

palashkaria commented 7 years ago

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).