colorプロパティの影響範囲
公開:
更新:
とりあえず仕様を見てみます。 This property describes the foreground color of an element’s text content. This property describes the foreground color of an element's text content. In addition it is used to provide a potential indirect value (currentColor) for any other properties that accept color values. If the ‘currentColor’ keyword is set on the ‘color’ property itself, it is treated as ‘color: inherit’.
Color Module Level 3の方では ボーダーを指定する際、ボーダーカラーが未指定の場合は CSS 2.1の「8.5.2 Border color」において、 If an element’s border color is not specified with a border property, user agents must use the value of the element’s ‘color’ property as the computed value for the border color. ではBorders Module Level 3ではどうなのかとCSS Backgrounds and Borders Module Level 3の「4.1. Line Colors: the ‘border-color’ properties」を見ると、 また、 構文を見ると分かる通り、色の指定は各種<length>と一緒に指定する必要がありますが、色の指定自体は任意です。 The color is the color of the shadow. If the color is absent, the used color is taken from the ‘color’ property. 色の指定がない場合は など、初期値がcurrentColorの説明が入っていますが基本は同じで、このプロパティは前景色を指定するプロパティであると書かれています。colorプロパティの影響を受ける例border-*-colorcolorプロパティで指定した色がボーダーカラーの計算済みスタイルとして使用されます。border-*-colorの初期値はthe value of the ‘color’ property
となっています。
また、次のようにも書かれています。border-*-colorの初期値はcurrentColorであると書かれています。currentColorの色はcolorプロパティによって決められるので、初期のボーダーカラーはやはりcolorプロパティで指定したものとなります。outline-colorも同様です。<shadow>の色
box-shadow, text-shadowプロパティの値に使用される形式で、構文は次のようになっています。<shadow> = inset? && [ <length>{2,4} && <color>? ]
未指定だとどうなるのか。それは<shadow>の説明文に書かれています。colorプロパティの指定を使うよ、ということです。その他
currentColorのもの。
まだあるかもしれません。
とりあえずcolorプロパティによって指定された色は文字色以外にも影響するということは覚えておきたいですね。