Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 1.01 KB

README.md

File metadata and controls

69 lines (51 loc) · 1.01 KB

alpha-values

Specify a scale for alpha values.

a {
  opacity: 10%;
}
/**        ↑
*          This alpha value */

This rule can automatically fix all of the problems reported.

This rule checks <percentage> alpha values.

This rule checks within color functions using modern syntax.

Modern color function syntax and <percentage> alpha values can be enforced, respectively, using the color-function-notation and alpha-value-notation rules in stylelint.

Options

array

Given:

[10, 20]

The following patterns are considered violations:

a {
  opacity: 5%;
}
a {
  color: hsl(0deg 0 0 / 25%);
}
a {
  color: hsl(var(--accent) / 50%);
}

The following patterns are not considered violations:

a {
  opacity: 10%;
}
a {
  color: hsl(0deg 0 0 / 20%);
}
a {
  color: hsl(var(--accent) / 20%);
}