Re: @media in style attribute

 From: Mikko Rantalainen <mira@cc.jyu.fi>
>
> Ernest Cline wrote:
> >From: Justin Wood <jw6057@bacon.qcc.mass.edu>
> >>
> >>just add a simple thing.
> > 
> > <example snipped using <link> and classes>
> > 
> >>This all will allow you to style the display correctly for those 
> >>elements (block etc;) in normal stylesheets/style attribs, and the 
> >>print.css and screen.css will over-ride them on a normal use.
> >>just add the class in there, along with any other classes you
> >>need, will save alot of UA download.
> >>
> >>As well as prevent UA's from /needing/ to impliment a pseudo
> >>class for something that we allready support via an @ rule.
> > 
> > 
> > I will have to disagree with you.  Setting style on an element
> > by using an attribute of an element (or a descendant of an
> > element, altho that is not the mechanism that is used at present)
> > of an element on an element instead of by a separate <style>
> > or <link> element that is not either an ancestor or descended
> > greatly eases the job of transcluding an element from another
> > document.
>
> I think that the style should be separated from content even for the 
> transcluded part. IMO, the transcluded part should by default use 
> the same style as the rest of the document - I really cannot see any 
> benefit for mixing different styles from different documents just 
> because some part of the document were "quoted".
>
> However, I can understand that some people expect functionality for 
> this so I propose following:
>
> Allow a stylesheet attribute that can be used to link to different 
> stylesheets and those stylesheets get additional specificity for the 
> element selectors that match any child selector.
>
> For example:
>
> <html> ...
> <body> ...
> <div>
> <div>
> <div id="ext" stylesheet="urn:source-of-this-transclusion-style">
> transcluded part
> </div>

<div id="ext" style="@import url(urn:source-ofthis-transclusion-style)">
transcluded part
</div

is already given by the style attribute draft for this purpose and it
doesn't require a separate attribute.

> Yes, the style attribute is easier to understand for the current 
> user base[2] but the question is, do we want to continue on our 
> quest for separating style from content? If we do, then we must not 
> allow any way to include style inline.

Separating style from content is a different issue that what you
discuss in your post (not all of which I quoted)  You advocate
that for each document that there be a single central point at
which style gets attached to the content.  Whereas a style
attribute allows for multiple points at which style can be
attached to the content.  Transclusions are easier to
implement if style can be attached to the content at the
point of transclusion instead of being forced to use a
central registry.  Both the central registry model and the
distributed model have their advantages.  Trying to lock
CSS into using only one of those two models is a bad idea.

Received on Friday, 21 May 2004 10:32:38 UTC