CSS Formatter - space after bracket for single-line rules

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".
Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!
Post Reply
tbleier
Posts: 7
Joined: Tue Aug 18, 2009 7:32 pm

CSS Formatter - space after bracket for single-line rules

Post by tbleier »

Hi,

I'm quite happy with the code formatter for CSS stylesheets (actually it was one of my reasons to buy a WeBuilder license :) ) but I would love to see and additional option to add a space after the opening and before the closing bracket for single line rules.

So instead of the current formatting:

Code: Select all

a {color: #808000;} 
it should look like this:

Code: Select all

a { color: #808000; } 
best regards,
__
/homas Bleier
User avatar
MikeyB
Top Contributor
Posts: 511
Joined: Fri Jun 09, 2006 10:38 am
Location: UK
Contact:

Re: CSS Formatter - space after bracket for single-line rules

Post by MikeyB »

This would definitely need to be an option as I prefer it without the spaces.
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Re: CSS Formatter - space after bracket for single-line rules

Post by syrupcore »

I'd love to see the same. agree it should be an option. (could just expose the regex)

I use a snippet that inserts "space+{+space+cursor+space}". I mapped it to ctrl+shift+{ and it's pretty natural to use but I still miss some and would be happy if the formatter caught them.


On the same subject...
I'd also love to see an option to "tab stop" a set of single line rules (if there are multiple without extra blank lines between).

Code: Select all

.myclass{color: red; }
.myclass div{ color: blue; }
.myclass a{ color: green; }
.myclass li{ color: black; }
would become

Code: Select all

.myclass        { color: red; }
.myclass div    { color: blue; }
.myclass a      { color: green; }
.myclass li     { color: black; }
where the formatter picks the first possible tab stop for the lines
tbleier
Posts: 7
Joined: Tue Aug 18, 2009 7:32 pm

Re: CSS Formatter - space after bracket for single-line rules

Post by tbleier »

Since we're talking about CSS formatter options I noticed one more thing: I mostly use the "Single line if rule would be less than x after collapsing" option, but I actually would prefer a "Single line if there is only one CSS attribute" option, i.e. not depending on the length, but on the number of CSS attribut definitions in a selector. I noticed that I often overlook the second or third attribute in a single-line selector, but the "multiple lines" option is a bit lengthy if you have many one-liners...
CaliforniaJerry
Posts: 88
Joined: Sat Aug 01, 2009 4:48 am
Location: Mountain View, CA
Contact:

Re: CSS Formatter - space after bracket for single-line rules

Post by CaliforniaJerry »

+1

I like the left-justified tab rule also. In fact that's what I do with multi-line entries as well.

Code: Select all

.content {
     color:         #333333;
     font-family:   "Lucida Grande", etc;
     font-size:     1em;
     line-height:   1.4em;
     min-height:    3em;
     overflow:      hidden;
}
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Re: CSS Formatter - space after bracket for single-line rules

Post by syrupcore »

CaliforniaJerry wrote:+1

I like the left-justified tab rule also. In fact that's what I do with multi-line entries as well.

Code: Select all

.content {
     color:         #333333;
     font-family:   "Lucida Grande", etc;
     font-size:     1em;
     line-height:   1.4em;
     min-height:    3em;
     overflow:      hidden;
}
I don't think I have the stamina to do that manually but man, I would love it if webuilder did it for me. :) so readable.
Post Reply