Re: [css3-background] A property to control background opacity

On Mon, Dec 23, 2013 at 4:33 PM, David <david.email@ymail.com> wrote:

> Hello,
>
> it would be great if a CSS property would be added to control the opacity
> of the background-image.
> The background-color and its opacity is already controlable via rgba() or
> hsla().
> The opacity property itself allows just to control the opacity of the
> whole element.
>

We had a short discussion on this at the last F2F during TPAC [1].
It was unfortunately not minuted. :-(

During the meeting, people said that this feature has been requested for a
long time but for some reason, it never was spec'ed out or implemented.

Normative text could look as follows:

The ‘background-opacity’ property

Defines the opacity of each background layer. The description of the ‘
background-opacity’ property is as follows:
‘background-opacity’
*Value:*  <alpha-value><http://dev.w3.org/csswg/css-color/#typedef-alpha-value>
#*Initial:*  1*Applies to:*  All HTML elements*Inherited:*  no*Percentages:*
  N/A*Media:*  visual*Computed value:*  as specified*Animatable:*  yes
<alpha-value> <http://dev.w3.org/csswg/css-color/#typedef-alpha-value>
The opacity to be applied to the element. It is interpreted identically to
its definition in rgba() <http://dev.w3.org/csswg/css-color/#funcdef-rgba>,
except that the resulting opacity is applied to the entire element, rather
than a particular color.

The ‘background-opacity’ list must be applied in the same order as ‘
background-image’<http://www.w3.org/TR/css3-background/#the-background-image>
[CSS3BG] <http://dev.w3.org/fxtf/compositing-1/#ref-CSS3BG>. This means
that the first element in the list will apply to the layer that is on top.
If a property doesn't have enough comma-separated values to match the
number of layers, the UA must calculate its used value by repeating the
list of values until there are enough.

If the ‘background’<http://dev.w3.org/csswg/css-backgrounds/#the-background>
 [CSS3BG] <http://dev.w3.org/fxtf/compositing-1/#ref-CSS3BG> shorthand is
used, the ‘background-opacity’ property for that element must be reset to
its initial value.

It should probably go in Backgrounds and Borders L3 [2] but it could also
go to Compositing and Blending L2

1: http://lists.w3.org/Archives/Public/www-style/2013Nov/0351.html
2: http://dev.w3.org/csswg/css-backgrounds/

Received on Tuesday, 24 December 2013 03:06:50 UTC