Sublime Forum

Is there a plugin to format CSS

#1

I’m looking for a quick way to take a bunch of css like this:

body {



}

and turn it into this

body { … … … }

Anything like that around?

0 Likes

#2

I dunno, but you can do it by hand real fast.
select all the … lines.
press cmd+shift+l to split the selection by lines.
press cmd+left to go to the beginning of the line.
press delete until everything’s on one line.

It’s easy in reverse, too: select the first semicolon, then press cmd+d until you’ve selected all the semicolons, press right, then press return.

0 Likes

#3

Very cool thank you.

0 Likes

#4

in case anyone is interested i created command which does exactly that (expand/compact/toggle css rules)
check it here https://gist.github.com/2863474

0 Likes

#5

[quote=“vitaLee”]in case anyone is interested i created command which does exactly that (expand/compact/toggle css rules)
check it here https://gist.github.com/2863474[/quote]

Thanks, this will come handy

1 Like