HighDots Forums  

Site feedback

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Site feedback in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Ben C
 
Posts: n/a

Default Re: Site feedback - 07-22-2009 , 05:45 AM






On 2009-07-22, Johannes Koch <koch (AT) w3development (DOT) de> wrote:
Quote:
Ben C schrieb:
On 2009-07-21, shapper <mdmoura (AT) gmail (DOT) com> wrote:

1. The color warnings.
Does this mean I always need to set a background color even if
transparent?

There is a small risk of a user stylesheet intervening and changing your
transparent to white. But I wouldn't really worry about that.

It would be quite strange for a user to have a stylesheet that set white
backgrounds on things and not color, unless they were trying to make
text invisible.

Consider the following.

author stylesheet:

body {
color: #000;
background: #fff
}
div#content {
color: #000;
background: transparent
}


user stylesheet:

body {
color: #fff;
background: #000
}


result:

body { /* user stylesheet wins */
color: #fff;
background: #000
}
div#content { /* from author stylesheet */
color: #000;
background: transparent /* #000 (from user stylesheet) */
}
Yes, that could happen, but perhaps the real lesson here is: don't use
background: transparent unless you're fairly sure you've also set the
background of whatever's behind (and of whatever's behind that if it's
transparent).

There will always be some risk even then, because whatever rule you used
to set the background of _that_ element (the one behind) may be
overridden by something more specific while the rule you used to set
text colour on the foreground may not be.

But there is always some degree of risk whatever you do-- the user can
always override either the background or the text colour but not
necessarily both, even if you always set background and color in the
same rule.

Reply With Quote
  #22  
Old   
Johannes Koch
 
Posts: n/a

Default Re: Site feedback - 07-22-2009 , 06:52 AM






Ben C schrieb:
Quote:
Yes, that could happen, but perhaps the real lesson here is: don't use
background: transparent unless you're fairly sure you've also set the
background of whatever's behind (and of whatever's behind that if it's
transparent).
Yes, transparent is dangerous.

Quote:
But there is always some degree of risk whatever you do-- the user can
always override either the background or the text colour but not
necessarily both, even if you always set background and color in the
same rule.
If the user does this, then it is his/her fault. You as a CSS author
should do your job properly, so that a proper user style sheet will not
cause problems with yout author style sheet.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.