Re: Display

-------- Original-Nachricht --------
> Datum: Wed, 28 Apr 2010 14:08:48 -0400
> Von: Aryeh Gregor <Simetrical+w3c@gmail.com>

> The general idea would be like this, I think.  When computing an
> element's style, UAs would compute two values: one as now, and one
> ignoring all author stylesheets.  If the first value evaluated to
> "default", then the second value would be used.  Otherwise the second
> value would be ignored.  (Of course, any equivalent implementation
> would be fine -- the UA need not actually remember both values in all
> cases.) 

I am not familiar with implementations. Is there a reason why the value "default" can't just be replaced by the respective value from the UA stylesheet at computing time?

> The reason for this is so that you can undo all CSS statements with
> later statements.  Because of CSS's cascading nature, it's common to
> have several stylesheets from different places layered on top of each
> other.  For instance, you often have a site-wide stylesheet and then a
> page-specific one.  MediaWiki has some stylesheets added by the core
> software, some more by the skin, some more by software extensions,
> some more added by site admins for all skins, some more added by site
> admins for a particular skin, and some more that each user can set up
> for himself.
> 
> Often one party here wants to override an earlier one, but can't
> actually change the earlier stylesheet, just add rules to his own.
> This usually works great.  But for instance, if a stylesheet sets
> textarea { font-family: Courier, monospace } (which always annoys me
> on Linux because Courier looks terrible for some reason), that can't
> be undone by a later stylesheet.  textarea { font-family: monospace }
> is wrong, because some browsers use proportional fonts for textareas.
> textarea { font-family: default } would have the desired effect.
> 
> It's come up for me at least once, but it's not a big deal to me, more
> like "would be nice to have".  I don't know if it would be worth the
> implementation effort to add such a feature.  Maybe other people can
> explain their real-life use-cases.

It is not exactly real-life, but an author might want to reset the UAs default typography not only for the textarea element. 
* { font:default } would be quite handy. 
Of course, in today's real life most authors rather do the contrary, get maximum control of the typography. But maybe in the future this could change, it might become cool to leave the body text definition to the user's browser settings.

The above is about resetting default values where these values are not known. The other case is resetting default values for multiple element types, such as in the original example of the display property. For example hiding an element's contents except the title, and showing it when the title is hovered:
div.showHide * {
  display:none;
}
div.showHide h2 {

}

-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/chbrowser

Received on Thursday, 29 April 2010 07:09:37 UTC