Proposal: Allow Support for Multiple External Style Sheets with Limited Scope

  _____  

From: Lonnie Best [mailto:w3@startport.com] 
Sent: Wednesday, July 06, 2005 1:48 PM
To: 'www-html@w3.org'
Subject: Reasons to Allow Multiple External Style Sheets with Inline or
Embedded Scope

 

Currently, external style sheets have global scope; they have the ability to
prescribe style for any markup element on a web page. I acknowledge that
this scope can be overridden by using embedded CSS, and also by using inline
CSS with the style attribute.

 

However, on complicated modular websites that are programmatically
constructed ("one *varyingly styled* div tag" at a time) much inline styling
redundancy occurs while overriding global styling. Additionally, unlike
external styling, these inline blocks of styling are not cached by the
browser; they are downloaded each time they are used on a website.

 

I propose "markup support" for a new styling property that would allow
embedded and inline style attributes the ability to call upon an external
style sheet that's scope is the same as if the styling properties were
embedded or inlined in the markup.

 

For example, if I imagined this property, it would be called "stylelink" and
it would work like this:

 

<div style="stylelink:url(http://www.LonnieBest.com/style.css)">

<p>I want all elements inside this div tag to be influenced by the external
style sheet specified in the stylelink property above, but I don't want any
other elements outside this div tag to be influenced at all by that external
style sheet specified in the stylelink property.

</p>

</div>

 

Please note that I am aware of the "link" markup element (used in the <head
/>):

<link rel="stylesheet" href="http://www.LonnieBest.com/style.css"
type="text/css">

 

But the problem with it, is that, no matter where you put this "link
element", the styles prescribed (by the external style sheet it references)
will be applied to all elements in the document; I want the styles to only
apply to the div tag mentioned above.

 

If the stylelink property (being proposed) existed, browsers would simply:

 

1.	Build a list of "external style sheet URLs" specified throughout the
page via the stylelink property (in embedded an inline style attributes). 
2.	Download all external style sheets not cached.
3.	Style all the elements that contain the  "stylelink property"
according to the external style sheets the "stylelink property" references
(with the same scope as if the style was written embedded or inline
respectively).

 

This would allow applications developers to build web sites from the ground
up "one programmatically constructed *varyingly styled* div tag at a time",
without style redundancy in the markup and WITH more browser-side caching of
"style blocks".

 

Respectfully,

 

Lonnie Lee Best

Received on Thursday, 7 July 2005 15:41:22 UTC