本文へ移動

declaration-property-value-disallowed-list

宣言内で許可されないプロパティと値のペアのリストを指定します。

a { text-transform: uppercase; }
/** ↑ ↑
* These properties and these values */

このルールの引数には、message セカンダリオプションを使用できます。

オプション

object: { "unprefixed-property-name": ["array", "of", "values", "/regex/", /regex/]|"value"|"/regex/"|/regex/ }

プロパティ名が"/"で囲まれている場合(例:"/^animation/")、正規表現として解釈されます。これにより、例えば、省略形を簡単にターゲットにすることができます。/^animation/animationanimation-durationanimation-timing-functionなどを含みます。

値についても同様です。正規表現の値は、宣言全体の値に対して照合され、特定の部分に対して照合されるわけではないことに注意してください。たとえば、"10px solid rgba( 255 , 0 , 0 , 0.5 )"のような値は、"/^solid/"(行頭境界に注意)とは一致しませんが、"/\\s+solid\\s+/"または"/\\bsolid\\b/"とは一致します。

引用符で囲まれた文字列値とurl()引数を誤って考慮しないように、正規表現の照合には注意してください。たとえば、"/red/""1px dotted red"のような値と同様に"\"foo\"""white url(/mysite.com/red.png)"にも一致します。

{
"transform": ["/scale3d/", "/rotate3d/", "/translate3d/"],
"position": "fixed",
"color": ["/^green/"],
"/^animation/": ["/ease/"]
}

次のパターンは問題とみなされます

a { position: fixed; }
a { transform: scale3d(1, 2, 3); }
a { -webkit-transform: scale3d(1, 2, 3); }
a { color: green; }
a { animation: foo 2s ease-in-out; }
a { animation-timing-function: ease-in-out; }
a { -webkit-animation-timing-function: ease-in-out; }

次のパターンは問題とみなされません

a { position: relative; }
a { transform: scale(2); }
a { -webkit-transform: scale(2); }
a { color: lightgreen; }
a { animation: foo 2s linear; }
a { animation-timing-function: linear; }
a { -webkit-animation-timing-function: linear; }