Re: [csswg-drafts] [css-cascade] `revert-layer` keyword in style attribute (#6743)

@xiaochengh to diagram, the current spec works like:

```
* - where revert-layer is defined
x - additional layers reverted
@ - the top layer to be applied
```
```
user agent     !important
style          !important       * 
author layer A !important *     x 
author layer B !important x *   x 
author layer C !important x x * x 
animations                x x x x 
style          normal     x x x x 
author layer C normal     x x x @ 
author layer B normal     x x @   
author layer A normal     x @     
user agent     normal     @
```

And you're proposing a much more limited scope, where only the current layer is reverted, separately for normal and important versions of a layer? Something like:

```
user agent     !important
style          !important       * 
author layer A !important *     @ 
author layer B !important @ *     
author layer C !important   @ *   
animations                    @   
style          normal         
author layer C normal
author layer B normal
author layer A normal
user agent     normal
```

To some extent, both of these will be new and possibly unexpected for authors, who have generally not thought about importance-reversal before now. Authors are likely to try reverting styles in a normal layer by using `!important` as an override. Although it has some additional implications, the current proposal achieves that goal - using the important layer to revert the normal layer.

I don't think it makes sense to revert the normal and important versions of a layer without touching the layers in-between? If authors want to override a normal rule with `revert-layer`, avoiding those implications, they can do that using specificity instead.

I'd be interested in @jensimmons perspective on this as well.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 17 November 2021 17:38:53 UTC