Skip to content

[feature request] Support CSS Custom Properties #7

@rictic

Description

@rictic

CSS Custom Properties are a relatively new standard. Work is in progress to support them in Edge, and they're shipping today in Chrome, Safari, and Firefox.

Custom property usage is fairly straightforward, just an expression like var(--prop-name) or var(--prop-name, exprAsFallbackValue). The main tricky bit is that the allowed syntax for custom property values is extremely permissive, allowing stuff like:

body {
  --js-might-read-this: if(x > 5) this.width = 10;

  --my-theme: {
    color: red;
    background: white;
  };
}

The latter style does see real world usage today to implement mixins, and is reported as a syntax error in vscode as of v1.7.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions