Skip to content

[css-cascade] revert-layer keyword in style attribute #6743

Closed
@xiaochengh

Description

@xiaochengh

What should we do when revert-layer is used in the style attribute?

For example, <div style="color: red; color: revert-layer">. I can think of two options:

  1. Treat style attribute as if in its own layer (though importance is handled differently), so we revert color to the highest author layer
  2. Style attribute is not in any layer, so color: revert-layer is an invalid declaration, and color: red wins the cascade

I prefer option 1 because it is simpler to implement (no parse-time special-casing). And other than an obscure way to cancel other declarations in the style attribute, I'm not sure if there is any real use case of putting revert-layer in the style attribute, so I prefer keeping things simple.

@mirisuzanne

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions