w3c / w3c/csswg-drafts

[css-env-1] Should env() really use <custom-ident>?

Open
#3,262 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-env-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

https://drafts.csswg.org/css-env-1/#env-function says:

env() = env( <custom-ident> , <declaration-value>? )

However both Blink and WebKit use just <ident> for this.

Test-case can be:

<!doctype html>
<style>
div {
    width: 100px;
    height: 100px;
    background-color: green;
    background-color: env(inherit, red);
}
</style>
<div></div>

Which should be green per spec but is red in Blink and WebKit.

Should the spec be changed to use just <ident>, or should bugs be filed on browsers?

I made the same mistake in https://bugzilla.mozilla.org/show_bug.cgi?id=1462233, but @heycam caught it during review.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CSS Env Level 1 env() definition at the linked specification section and compare its grammar with the reported Blink and WebKit behavior. Run the provided HTML test case to confirm the difference, then resolve whether the specification or browser behavior should change and document the resulting decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html
Domain
documentation, web-dev
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.