[TYPO3-dev] CSS Coding GuidLines

Christopher Torgalson bedlamhotel at gmail.com
Mon Jun 2 09:01:40 CEST 2008


On Mon, Jun 2, 2008 at 8:47 AM, Dmitry Dulepov [typo3] <dmitry at typo3.org> wrote:
> Steffen Kamper wrote:
>> 1. use lower case for all selectors except named classes or id's that use
>> camelCase
>
> I like tags in upper case: TABLE.className instead of table.className. Much easier to see tag.


No. TYPO3 insists on using xhtml only, and in xhtml, 'TABLE' is not
the same thing as 'table' [1]. Besides, any decent editor (e.g.
Textmate) displays, or can display, various selectors in different
colours.


>> 2. use following formatting rules:
>>
>> selector[SPACE]{
>> [TAB]style:[SPACE]value;
>> }
>> [empty line]
>
> .link {
>        color: red
> }
>
> looks visually longer and slower to understand than
>
> .link { color: red; }


Sure, it's ok with *one* property, but what about with multiple
properties? It becomes totally incomprehensible with a long list:

.someClass {
	font-size:150%; border-top:1px solid #9ab; border-bottom:1px solid
#9ab; padding-top:.125em; padding-bottom:.125em; margin:0;
background-color:#f90; background-image:url(path/to/img.jpg);
background-repeat:no-repeat; background-position:0 0; float:right;
}


-1 to both suggestions from me.


[1] http://www.w3.org/TR/xhtml1/#h-4.2

-- 
Christopher Torgalson
http://www.typo3apprentice.com/




More information about the TYPO3-dev mailing list