Skip to content

[css-properties-values-api] Expand the set of syntaxes for which initial-value is optional #1043

Open
@LeaVerou

Description

@LeaVerou

I have lately been using @property a fair bit, and in nearly every real case, I had wished initial-value could have just been automatically set based on my syntax.

There are several cases where there is a very obvious default that works for the vast majority of cases:

  • <length>: 0
  • <number>: 0
  • <angle>: 0deg
  • <color>: transparent
  • <integer>: 0
  • <percentage>: 0%
  • <time>: 0s
  • <resolution>: 0dpi

In my experience, this would simplify over 90% of @property uses.

We discussed making all descriptors optional in #994, but that was mainly centered around inherits. Also, since initial-value is already optional for some cases, maybe it's more acceptable to make it optional for more cases?

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