Sublime Forum

Align/columnize CSS rules?

#1

I was looking for a plugin to do this with a CSS selection:

.scroller-content               { float: left; padding-top: 15px; width: 250px; height: 240px; }
.scroller-content ul            { float: left; margin: 0; padding: 0; list-style-type: none; }
.scroller-content li            { float: left; padding: 0 10px; width: 104px; height: 240px; }
.scroller-content li a          { display: block; margin: 4px 0; color: #686155; text-decoration: none; font-weight: bold; font-size: 11px; }
.scroller-content li a:hover    { text-decoration: underline }
.scroller-content .sale         { color: #bc1a2d }

The “Alignment” plugin doesn’t seem to do it, at least not out-of-the-box. I did the above using a separate app called ProCSSor on Mac.

Any ideas?

0 Likes

#2

Haven’t looked much into it, but you might want to check this plugin https://github.com/randy3k/AlignTab

0 Likes

#3

If all of your CSS rules are single line, you could change the alignment chars for CSS to “{” by copying github.com/wbond/sublime_alignm … e-settings into your Packages/User/ folder and customizing to your liking.

If only sometimes you have single-line CSS rules:

  1. Select the first {

  2. Press ctrl+d until all opening { are selected

  3. Press ctrl+alt+a to align them

0 Likes