wix / stylable

Stylable - CSS for components
https://stylable.io
MIT License
1.27k stars 62 forks source link

fix(formatter): respect multi-line decl initial comment line #2965

Closed idoros closed 3 months ago

idoros commented 3 months ago

This PR fixes the handling of multi-line declaration values to preserve the original position of comments at the top level of declarations.

For example, given the unformatted code:

.a {
    prop:
            /*initial comment*/
        val1
                val2  
}

Before this PR, the comment would be moved to the declaration line:

.a {
    prop: /*initial comment*/
        val1
        val2  
}

After this PR, the comment remains on its own line:

.a {
    prop:
        /*initial comment*/
        val1
        val2  
}