Skip to content

New Rule: alpha-value-notation #75

Closed as not planned
Closed as not planned
@azat-io

Description

@azat-io

Rule details

Specify percentage or number notation for alpha-values.

What type of rule is this?

Warns about a potential problem

Example code

There are two ways to set alpha notation.

Number:

.test {
  color: rgb(0 0 0 / 0.5);
  opacity: 1;
}

Percentage:

.test {
  color: rgb(0 0 0 / 50%);
  opacity: 100%;
}

I think it would be good to have a rule to check this.

{
  rules: {
    'alpha-value-notation': ['error', 'percentage'],
  },
}

Participation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions