跳到主要內容

值關鍵字大小寫

指定關鍵字值的字體大小寫。

    a { display: block; }
/** ↑
* These values */

此規則忽略已知屬性的 <custom-idents>。與非屬性配對的關鍵字值(例如 $vars 和自訂屬性),且不符合主要選項,可以使用次要選項 ignoreKeywords: [] 忽略。

fix 選項 可以自動修復此規則報告的所有問題。

message 次要選項 可以接受此規則的參數。

選項

字串"lower"|"upper"

"lower"

以下模式被視為問題

a {
display: Block;
}
a {
display: bLoCk;
}
a {
display: BLOCK;
}
a {
transition: -WEBKIT-TRANSFORM 2s;
}

以下模式不是問題

a {
display: block;
}
a {
transition: -webkit-transform 2s;
}

"upper"

以下模式被視為問題

a {
display: Block;
}
a {
display: bLoCk;
}
a {
display: block;
}
a {
transition: -webkit-transform 2s;
}

以下模式不是問題

a {
display: BLOCK;
}
a {
transition: -WEBKIT-TRANSFORM 2s;
}

選配次要選項

ignoreKeywords: ["/regex/", /regex/, "non-regex"]

忽略關鍵字值的字體大小寫。

例如,使用 "lower"

給定

["Block", "/^(f|F)lex$/"]

以下模式被視為問題

a {
display: bLoCk;
}
a {
display: BLOCK;
}
a {
display: fLeX;
}
a {
display: FLEX;
}

以下模式不是問題

a {
display: block;
}
a {
display: Block;
}
a {
display: flex;
}
a {
display: Flex;
}

ignoreProperties: ["/regex/", /regex/, "non-regex"]

忽略所列屬性的值的字體大小寫。

例如,使用 "lower"

["/^(b|B)ackground$/", "display"];

以下模式被視為問題

a {
text-align: LEFT;
}
a {
text-align: Left;
}

以下模式不是問題

a {
display: bloCk;
}
a {
display: BloCk;
}
a {
display: BLOCK;
}
a {
display: block;
}
a {
background: Red;
}
a {
Background: deepPink;
}

ignoreFunctions: ["/regex/", /regex/, "non-regex"]

忽略所列函數內值的字體大小寫。

例如,使用 "upper"

["/^(f|F)oo$/", "t"];

以下模式被視為問題

a {
display: b(inline);
}
a {
color: bar(--camelCase);
}

以下模式不是問題

a {
display: t(flex);
}
a {
display: t(fLeX);
}
a {
color: t(--camelCase);
}
a {
color: foo(--camelCase);
}
a {
color: Foo(--camelCase);
}

camelCaseSvgKeywords: true | false(預設:false

如果為 true,此規則預期 SVG 關鍵字在主要選項為 "lower" 時為駝峰式大小寫。

例如,使用 true

以下模式被視為問題

a {
color: currentColor;
}

以下模式被視為問題

a {
color: currentcolor;
}