cssbeautify icon indicating copy to clipboard operation
cssbeautify copied to clipboard

more formatting options

Open paulirish opened this issue 14 years ago • 6 comments

the options at http://procssor.com/ pretty much capture the most common style differences between authors. having those present would be awesome.

paulirish avatar Nov 17 '11 23:11 paulirish

We'll slowly go there :)

Next in my TODO list is an option to split the selectors, each into its own line.

ariya avatar Nov 18 '11 02:11 ariya

I’d like to see an option to automatically add ; after each declaration (even if the source file didn’t have one). So…

.menu{color:red} .navigation{background-color:#333}

…which currently beautifies into:

.menu {
    color: red
}

.navigation {
    background-color: #333
}

…would become:

.menu {
    color: red;
}

.navigation {
    background-color: #333;
}

mathiasbynens avatar Jan 30 '12 09:01 mathiasbynens

Automatic semicolon: commit 959c17cff1.

ariya avatar Sep 28 '12 22:09 ariya

An option to add a space after each comma that separates multiple values or selectors would be neat, too. (Or maybe 1 space should be the default?)

E.g.

.foo,.bar{font-family:foo,bar,baz}

…would then beautify into:

.foo, .bar {
  font-family: foo, bar, baz;
}

Perhaps the “space character” after a comma should be a separate setting, as some people like to use a line break instead of a good o’ U+0020 there, e.g.:

.foo,
.bar {
  font-family: foo, bar, baz;
}

mathiasbynens avatar Mar 07 '13 11:03 mathiasbynens

Similar feature request: add space before the parens that start a media query expression, and after each semicolon inside a media query expression that separates a property from a value. E.g.

@media(min-width:30em){x{foo:bar}}

…currently beautifies into:

@media(min-width:30em) {
  x {
    foo: bar;
  }
}

…but it could be:

@media (min-width: 30em) {
  x {
    foo: bar;
  }
}

mathiasbynens avatar Mar 07 '13 11:03 mathiasbynens

Guys, you are welcome to https://github.com/csscomb/csscomb.js

mishanga avatar Sep 05 '13 22:09 mishanga