inverted-colors
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
inverted-colors
は CSS のメディア特性で、ユーザーエージェントまたはその下の OS が色を反転しているかどうかを調べるために使用することができます。
構文
例
HTML
html
<p>
If you're using inverted colors, this text should be blue on white (the
inverse of yellow on black). If you're not, it should be red on light gray.
</p>
<p>
If the text is gray, your browser doesn't support the `inverted-colors` media
feature.
</p>
CSS
css
p {
color: gray;
}
@media (inverted-colors: inverted) {
p {
background: black;
color: yellow;
}
}
@media (inverted-colors: none) {
p {
background: #eee;
color: red;
}
}
結果
仕様書
Specification |
---|
Media Queries Level 5 # inverted |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
inverted-colors media feature |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.