- From: fantasai <fantasai@escape.com>
- Date: Tue, 26 Mar 2002 02:00:39 -0500
- To: www-style@w3.org
Tantek Çelik wrote: > > text-decoration-opacity I think text-decoration can be fairly grouped with text, especially since it doesn't have a separate color property, either. (And if there were separate opacity properties, border and outline opacity could have an initial value of <foreground-opacity>, just as border-color has an initial value of <color>). > It is much simpler to introduce 2 new color value types which can then be > used with all properties that specify a color, rather than add 5-9 new > properties. > > In addition, the new color value types permit controlling the opacity of > these pieces of elements independently of elements' children, which the > opacity property does affect. Which shows the fundamental problem with declaring rgba and hsla the solution to separating background and foreground opacity. Suppose I have a <div>. I want the the <div>'s background to be translucent, but it's text should be opaque so it's easily readable. It's a reasonable request, no? <div class="sidebar"> <p>Paragraph text.... <a href="file.html">Link</a>... So <strong>DON"T FORGET...</strong> etc. </p> </div> Your suggestion would be to set the background as a transparent color. Thus: .sidebar { background: rgba(255, 255, 0, .5); } Which works fine, except I also happen to have these rules in effect: :link, :visited { background: #FFBB00; color: #000033; } strong { background: #FF0000; color: #000000; } So the background on the link and emphasized notice is opaque. This is not according to my design, and IMO, it looks bad. So now I have to write separate rules for any elements in a sidebar, adjusting the background color's opacity accordingly. This isn't much of a problem if I only have to deal with sidebars, and only with links and strong emphasis. However, using this approach with a complicated stylesheet and a large variety of elements is inelegant and prone to mistakes.
Received on Tuesday, 26 March 2002 01:57:23 UTC