views:

151

answers:

3

I'm unable to figure how the standard (or just popular) brace style names apply to CSS. Here're all the brace styles:

/* one - pico? */
selector { property: value; 
           property: value; }

/* two - pico extra */
selector { 
    property: value; /* Start Properties on Newline */
    property: value; }

/* three - horstmann? */
selector 
{ property: value;
  property: value;
}

/* four - GNU? */
selector 
{ 
    property: value; /* Start Properties on Newline */
    property: value;
}​

/* five - GNU Saver */
selector { property: value;
           property: value;
}

/* six - CSS Default */
selector { 
    property: value; /* Start Properties on Newline */
    property: value;
}

/* seven - Braces Aligned */
selector { property: value;
           property: value;
         }

/* eight - Banner? */
selector {
    property: value; /* Start Properties on Newline */
    property: value;
    }

Can someone please name each brace style for me?

Many thanks!

+2  A: 

I think you named the most popular indent styles yourself. I personally, prefer:

.class {
  property: value;
}
Gabriel Evans
I've named all the 8, please help improve if you can.
Nimbuz
+4  A: 

I would say three is Horstmann.

Pico as it is, but the opening brace starts on a newline.

Banner would be;

selector {
    property: value;
    propert: value;
    }

I took most of these from Indent style on Wikipedia :)

TheDeadMedic
I've named all 8, can you help improve them if you can. :)
Nimbuz
Six is 'OTBS' (One True Brace Style), four is Allman
TheDeadMedic
Okay thanks. Can you suggest better names for 'Pico Extra' and 'GNU Saver' :P
Nimbuz
I'm not sure there is a 'named' style for every one you've got there - I did find this, http://gulati.info/2010/01/different-brace-styles-in-php, which helps highlight the differences, specifically between GNU and Horstmann.
TheDeadMedic
A: 

I sometimes write css with the starting- and ending brace on the same line.
Often used like:
.foo {width:100%;height:550px;}

How would this be named?

/* Nine - Almost-optimized(?) */
selector { property: value; property: value; }

hellozimi