Skip to content

Rule Change: Add more allow* options to use-baseline rule #298

@thecalamiity

Description

@thecalamiity

What rule do you want to change?

use-baseline

What change do you want to make?

Generate fewer warnings

How do you think the change should be implemented?

Add options to allow specific CSS functions, media conditions, and property values to be exempt from baseline enforcement.

Example code

.selector {
  color: color-mix(in srgb, plum, #123456);
  clip-path: fill-box;
}

@media (scripting: none) {}

What does the rule currently do for this code?

It reports that:

  • The color-mix() function is not a widely available baseline feature.
  • The value fill-box for clip-path is not a widely available baseline feature.
  • The media condition (scripting: none) is not a widely available baseline feature.

Currently, these cannot be selectively allowed.

What will the rule do after it's changed?

If configured like this:

"css/use-baseline": [
  "error",
  {
    "available": "widely",
    "allowFunctions": ["color-mix"],
    "allowMediaConditions": ["scripting"],
    "allowPropertyValues": {
      "clip-path": ["fill-box"]
    }
  }
]

then the rule would not report errors for the above code.

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

No response

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionenhancementNew feature or request

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions