Re: [csswg-drafts] [css-position] 'front' & 'back' keywords for z-index

> Initially, the `@layer` rule would probably not contain much, perhaps a background and size, but it could be extended to be like layers in image editors, i.e. blend modes etc.

Thinking more about that, I believe there's no need for an `@layer` rule. Layers are already created via the stacking context. And the `z-index` property's purpose is to influence the order of the stack level, which can be seen as a layer. And background blending can already be achieved via the [`mix-blend-mode`](https://drafts.fxtf.org/compositing-1/#mix-blend-mode) property.

> As far as the ads example, people can always choose to run "broken" ads if they want, at least the ad might thrash the users experience a bit less this way?

Website authors often use advertising frameworks, they don't choose the ads by themselves. And there are always bad providers that try to abuse things like this.

> I'd imagine there's nothing wrong with handling it the same way we already handle multiple elements with the same `z-index` values in the same stacking context, we let the document order be the last defense? These keywords could at least be *some control over a need to put one element in front or behind everything.

Sure, I'm personally not against adding them, it's just that they can easily be abused.

It's then up to authors to use them wisely. And if used that way, they'd avoid those arbitrary high numeric values in a nice way. @tabatkins From a spec. writer and implementer view, does there anything speak against introducing those keywords?

Sebastian

-- 
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2444#issuecomment-429146210 using your GitHub account

Received on Thursday, 11 October 2018 22:47:51 UTC