Skip to content

[css-env-1] environment variables as redundant mechanism #3350

@srsgores

Description

@srsgores

After reading the proposal spec on CSS environment variables, I find the proposed env keyword redundant and misleading:

  1. Introduces a new function which essentially does the same thing as var()
  2. Lacks a clear specificity on how var() plays with env()
  3. Adds another level of complexity to CSS for new learners which may impede or slow down learning

Instead, I propose using the familiar var keyword already available. UAs can predefine custom properties to known variable names. It seems to me that the draft tries to solve a problem that really isn't there for most authors.

For fallbacks, the author may define those using the normal :root or specificity.

Instead of focusing on creating a new function, let's focus on a naming convention for UAs to follow that standardizes the variable names we can use.

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