Skip to content

fix: correctly extract baseline support for CSS functions#401

Open
xbinaryx wants to merge 1 commit intoeslint:mainfrom
xbinaryx:css-function-baseline-support
Open

fix: correctly extract baseline support for CSS functions#401
xbinaryx wants to merge 1 commit intoeslint:mainfrom
xbinaryx:css-function-baseline-support

Conversation

@xbinaryx
Copy link
Contributor

@xbinaryx xbinaryx commented Mar 19, 2026

Prerequisites checklist

AI acknowledgment

  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

What did you do?

a {
	background-image: image("foo.png", red);
}

What did you expect to happen?

use-baseline should report image() as a non-baseline CSS function.

What actually happened?

No lint error was reported for image().

What is the purpose of this pull request?

This PR fixes CSS function baseline extraction in the generator.

The previous logic would treat CSS data types as CSS functions when reading css.types.* compat keys. In practice, that meant image() could fail to report correctly because css.types.image (<image>) was being conflated with the image() function.

What changes did you make? (Give an overview)

Refactored function extraction so CSS functions are handled explicitly, regenerated baseline-data.js, and added regression coverage.

Related Issues

Is there anything you'd like reviewers to focus on?

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/image/image

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Mar 19, 2026
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Mar 19, 2026
@DMartens
Copy link

Thank you for spotting this.
In the future please split up the PR in the fix and refactor as combining them makes it harder to review.
How did you determine that only image and color are affected?
For example I tried sibling-index which is also non-baseline but use-baseline does not report it.

@xbinaryx
Copy link
Contributor Author

In the future please split up the PR in the fix and refactor as combining them makes it harder to review.

Yeah sorry about that. I had to refactor first to avoid making the code uglier with this fix.

How did you determine that only image and color are affected?

They’re the direct bare css.types.<name> collisions I identified.

For example I tried sibling-index which is also non-baseline but use-baseline does not report it.

sibling-index() is part of a broader gap here, same as sibling-count(), shape(), progress(), if(), etc. Those exist in web-features, but not in mdn-data.css.functions, so use-baseline doesn’t currently recognize/report them.

This should be addressed by the mdn-data -> @webref/css migration in #376, which I’m working on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants