Skip to content

Latest commit

 

History

History
93 lines (65 loc) · 1.05 KB

File metadata and controls

93 lines (65 loc) · 1.05 KB

number-max-precision

Limit the number of decimal places allowed in numbers.

a { top: 3.245634px; }
/**           ↑
 * These decimal places */

选项

int: Maximum number of decimal places allowed.

例如,使用 2

以下模式被视为违规:

a { top: 3.245px; }
a { top: 3.245634px; }
@media (min-width: 3.234em) {}

以下模式被视为违规:

a { top: 3.24px; }
@media (min-width: 3.23em) {}

可选的辅助选项

ignoreUnits: ["/regex/", /regex/, "string"]

Ignore the precision of numbers for values with the specified units.

例如,使用 2

给定:

["/^my-/", "%"]

以下模式被视为违规:

a { top: 3.245px; }
a { top: 3.245634px; }
@media (min-width: 3.234em) {}

以下模式被视为违规:

a { top: 3.245%; }
@media (min-width: 3.23em) {}
a {
  width: 10.5432%;
}
a { top: 3.245my-unit; }
a {
  width: 10.989my-other-unit;
}