Re: [svgwg] Opacity properties should affect nothing but opacity

> That's not true, the example does use groups. The opacity is changed
 on the div element,
 > which is a grouping element. The z-index is applied to the object 
within the group.

Oops, you're right! A mistake on my part. I hadn't looked properly it 
seems and thought that opacity was applied to the span. Sorry.

It then works beautifully, as Tab had explained to me:
"opacity etc are 100% side-effect free when they're applied to 
elements that don't have children. (even if there is z-index etc)"

In http://codepen.io/philipwalton/pen/dfCtb , when I change the first 
rule from
```
div:first-child {
  opacity: .99; 
}
```
to
```
.red {
}
```
:
The red item is behind the other items (following the document order),
 then brought to the foreground using "z-index: 1". Then when I (in 
the first rule) set ```opacity: 1```, nothing changes (as expected), 
and when I change the opacity value to "0.5", the opacity of that red 
items gets changed as intended - without a side-effect changing the 
stacking/overlaps. Beautiful.

Not sure what could be done regarding the potentially confusing 
results in the other cases (while staying backwards-/CSS-compatible). 
Regarding your above idea for reducing confusion - probably best to 
discuss it directly with the SVG WG and CSS WG.

Thanks all!

-- 
GitHub Notification of comment by tobireif
Please view or discuss this issue at 
https://github.com/w3c/svgwg/issues/264#issuecomment-247291148 using 
your GitHub account

Received on Thursday, 15 September 2016 10:21:18 UTC