Skip to content

[css-values] Allow unset to use revert for non-inherited properties, instead of initial #12341

Closed
@benface

Description

@benface

This would allow actually resetting all properties to what they were before some arbitrary CSS was applied, e.g. in a subtree:

/* bunch of CSS here */

#vendor-controlled-section {
  &, *, *::before, *::after {
    all: unset; /* all `div`s in this section will be inline! 😱 */
  }
}

A couple ideas for the syntax:

  1. Make unset a function that accepts which value to use for non-inherited properties; unset would default to unset(initial) but the above would use unset(revert). Maybe there's even a use case for unset(revert-layer)? 🤔
  2. Add a new value named unset-revert.
  3. Add a new value named reset. Would that be confusing / unclear what the difference is with unset?
  4. Add two new values named revert-or-inherit and initial-or-inherit, and make unset an alias for the latter.

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