W3C home > Mailing lists > Public > www-style@w3.org > November 2003

Re: [css3-cascade] Proposed property: rule( sSelector );

From: Chris Moschini <cmoschini@myrealbox.com>
Date: Wed, 05 Nov 2003 10:26:15 -0500
To: rijk@iname.com
Cc: www-style@w3.org
Message-ID: <1068045975.8def4820cmoschini@myrealbox.com>

Rijk van Geijtenbeek [rijk@iname.com] wrote:
> Why can't you use the existing classes and IDs? In general, if there
> is a hook, it can be selected. If it can be selected, it can be
> grouped. If it can be grouped, it can be changed at one place.

Yes - but in this example, this was not the case.


> Who says you can't edit more than one CSS file? To me this seems a far
> fetched scenario. Cascading is nice and all, but the page styling will
> not often be split in parts controled by different parties [1].

Where is [1]? As for not being able to edit more than the CSS file; the frequency of this
scenario is a matter of opinion (it's happened at my company on several occasions). But as I
stated:

>> That's fine, but not in a Zen Garden style site, where changing the look and feel means NEVER
>> touching the HTML. This is the ideal I'm trying to push for, and I think it's the goal of CSS
>> in general. A Zen Garden style site emphasizes this goal but preferably any site could receive
>> such a thorough redesign without touching the HTML.

So regardless of how often such strict limitations arise, it is nonetheless ideal that CSS can
provide this functionality.

Further, I've already stated that part of this is the ability to group styles into an
appropriate section. It's difficult to convey how confusing this is without using a lot of
of CSS, but, assume there are 7 distinct sections that might appear on any page. To keep this
short, assume there are say, 5 rules between each comment.

/*
Global
*/
#related, #links, #content, #info, #nav, #navtext, #description {
	margin: 0 1em;
}

/*
related, links, content, info
*/
#related, #links, #content, #info, {
	background: #309 url( 'night.jpg' );
}

/*
content, nav, description
*/
#content, #nav, #description {
	padding-left: 15px;
}

/*
content, info, nav
*/
#content, #info, #nav {
	color: #ffc;
}

/*
related, links, nav, navtext
*/
#related, #links, #nav, #navtext {
	border-bottom: 1px solid #000;
}

/*
content, info
*/
#content, #info {
	border: 2px solid #ff0;
}


Now, assume as I said each section is 5 times as long - a fairly long file, but still not
nearly as complex as the CSS from a real site - where there would be classes, and more complex
selectors all mixed in here.

I want to know - what styles are applying to #info? Remember the size of the file. Good luck
finding the one property that's causing a weird gap on the left. There is no organization to
this file! Every bit of every distinct section of your site is strewn everywhere in your CSS,
and it's all because you tried to color coordinate.

I know an immediate response is "You could've used classes to group them!" But this assumes
that the designer wrote the HTML (unlikely, and, not an ideal restriction), and, it assumes
that the HTML ought to be modified for the design - but adding those classes would lock this
HTML page into THIS design, meaning next redesign (or, as in Zen Garden sites, alternate
design), the HTML must again be modified for appropriate groupings. This voids the intent of
CSS, so class grouping is not the answer.

-Chris "SoopahMan" Moschini
http://hiveminds.info/
http://soopahman.com/
Received on Wednesday, 5 November 2003 10:26:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:25 GMT