Skip to content

Bug: relative-font-units does not handle inherit #193

Open
@sdavids

Description

@sdavids

Environment

ESLint version: 9.28.0
@eslint/css version: 0.9.0
Node version: 22.16.0
npm version: 11.4.2
Operating System: Darwin redacted 21.6.0 Darwin Kernel Version 21.6.0: Mon Jun 24 00:56:10 PDT 2024; root:xnu-8020.240.18.709.2~1/RELEASE_X86_64 x86_6

Which language are you using?

rule

What did you do?

Configuration
      "css/relative-font-units": [
        "error",
        {
          allowUnits: ["rem"],
        },
      ],
  h1 {
    font-size: inherit;
  }

What did you expect to happen?

inherit is either ignored by default or there is a configuration option to ignore it.

What actually happened?

error  Use only allowed relative units for 'font-size' - rem    css/relative-font-unit

Link to Minimal Reproducible Example

https://github.com/eslint/css

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

It might make sense to also be able to ignore the other global values:

/* Global values */
font-size: inherit;
font-size: initial;
font-size: revert;
font-size: revert-layer;
font-size: unset;

https://developer.mozilla.org/en-US/docs/Web/CSS/font-size#syntax

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionfeature

Type

No type

Projects

Status

Ready to Implement

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions