Hi all,
I have some thoughts regarding the aesthetic structure of CSS that I
would like to share. It's just something that came to my mind at work
today, nothing more, nothing less..
When using descendant selectors many of us write our code like below.
#nav-main {
property: value
}
#nav-main ul {
property: value
}
#nav-main ul li {
property: value
}
#nav-main ul li a {
property: value
}
I have no problem with that, but it would be much easier to see the
hierarchy if it would be possible to write nested code more like a js,
as, php etc function. That way we wouldn't have to repeat #nav-main
before the nested selectors all the time. Look at the example below. I
mean, it's quite obvious that ul and li is descendant from #nav-main.
Like I said before, this was just something that came to my mind. I
haven't gave this much thought. There's probably tons of disadvantages
that I haven't think of. I just can't let go of the beauty in the
visual structure. Well, that is my opinion ofcourse. :) First thing
would be to make the rendering engine to understand that there can be
a selector in the same area as the property.
So, what do you think?
#nav-main {
property: value;
ul {
property: value;
li {
property: value;
a {
property: value;
}
}
}
}
**
With Best Regards,
Tommy Ahlbäck
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/