accent-color: 協調色;
フォーム要素の協調色を指定します。現時点での対応要素は、以下の各要素です。
- <input type="checkbox">
- <input type="radio>
- <input type="range">
- <progress>
色値を指定した場合は、その色が協調色として使用され、auto を指定するとブラウザが選択した色が使用されます。
使用上の注意事項
accent-color プロパティの使用例は、以下の通りです。
使用例(HTML)
<div class="accent-color">
チェックボックス(accent-color: auto;):<input type="checkbox" name="accent-color-checkbox1" value="1" checked style="accent-color: auto;"><br>
チェックボックス(accent-color: red;):<input type="checkbox" name="accent-color-checkbox2" value="1" checked style="accent-color: red;"><br>
ラジオボタン(accent-color: auto;):<input type="radio" name="accent-color-radio1" value="1" checked style="accent-color: auto;"><br>
ラジオボタン(accent-color: red;):<input type="radio" name="accent-color-radio2" value="1" checked style="accent-color: red;"><br>
範囲(accent-color: auto;):<input type="range" name="accent-color-range1" min="1" max="100" value="50" style="accent-color: auto;"><br>
範囲(accent-color: red;):<input type="range" name="accent-color-range2" min="1" max="100" value="50" style="accent-color: red;"><br>
プログレスバー(accent-color: auto;):<progress value="60" max="100" style="accent-color: auto;">60%</progress><br>
プログレスバー(accent-color: red;):<progress value="60" max="100" style="accent-color: red;">60%</progress><br>
</div>
使用例(CSS)
.accent-color input[type="checkbox"],
.accent-color input[type="radio"] {
width: 30px;
height: 30px;
}