RE: [css3] CSS3 Syntax

Hi,

From: Sebastian Gräßl <sebastian.graessl@gmail.com>
>For a long time now i have the idea of an Syntax change in CSS.
>I think it should be more like a DOM-Tree.
>In fact it should only have the ability to write definitions in 
>defintitions.
>A short Example:
>
>ul {
>    li {}
>}

This would mean that if you had one "root" ruleset (e.g. "html") then 
current CSS parsers would all ignore your entire style sheet (except for any 
declarations for "html"). Not really graceful degradation that all CSS 
updates strive for.

However, there's nothing stopping you from using your custom syntax and then 
have a script that converts it to real CSS. You can add things like 
constants and more fancy selectors, too, without adding any burden to 
implementors or breaking backwards compatibility.

>but it should be still possible, and that's something important to slowly 
>introduce it, to write:
>
>ul li {}
>
>and overwrite the definition of a li in an ul.
>
>Why do i think it is a good idea?
>
>1) Well, i work at a shop where lot's of XML stuff get's done an teammates 
>who have to work with/on my CSS don't quitly, in fact they hardly 
>understand selectors like:
>
>#menu ul li ul li ul {}

FWIW, this can most probably be written as:

   #menu ul ul ul {}

Selectors aren't that hard to understand IMHO, and introducing yet another 
way to do it would only confuse matters more, I believe.

And there's no reason you can't use the current syntax as a "tree". Just put 
the rulesets in the correct order (as if you had a tree) and indent them 
appropriately. I do this because it makes for easier maintanence.

>2) It helps (or forces) you to better design your CSS, which helps you also 
>to debug your code.
>     I often have the bad habbit, that when i have to hurry i simply add a 
>definition somweher in my CSS.

I don't see how it forces better design at all. You can still make your 
style sheets unorganized. Espeially since the old syntax still has to work.

>3) File size. i have two stylesheet attached, one with ordinary syntax and 
>one with the nested syntax.

Use gzip compression if you're worried about file size.

Regards,
Simon Pieters

_________________________________________________________________
Alla lediga jobb för bartenders http://jobb.msn.monster.se/

Received on Wednesday, 13 December 2006 13:50:32 UTC