unit-no-unknown
不明な単位の使用を禁止します。
a { width: 100pixels; }
/** ↑
* These units */
このルールでは、エディターズドラフトを含むCSS仕様で定義されている単位を既知の単位と見なします。
message
セカンダリオプションはこのルールの引数を受け入れることができます。
オプション
true
次のパターンは問題と見なされます
a {
width: 10pixels;
}
a {
width: calc(10px + 10pixels);
}
次のパターンは問題と見なされません
a {
width: 10px;
}
a {
width: 10Px;
}
a {
width: 10pX;
}
a {
width: calc(10px + 10px);
}
オプションのセカンダリオプション
ignoreUnits: ["/regex/", /regex/, "string"]
指定された
["/^--foo-/", "--bar"]
次のパターンは問題と見なされません
a {
width: 10--foo--baz;
}
a {
width: 10--bar;
}
ignoreFunctions: ["/regex/", /regex/, "string"]
指定された
["foo", "/^my-/", "/^YOUR-/i"]
次のパターンは問題と見なされません
a {
width: foo(1x);
}
a {
width: my-func(1x);
}
a {
width: YoUr-func(1x);
}