CSSConditionRule.conditionText
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.
conditionText
は CSSConditionRule
インターフェイスのプロパティで、この CSS ルールのテキストを返したり設定したりします。
値
CSSOMString
です。
例
次の例は、 conditionText
の値を CSSMediaRule
インターフェイスを実装した CSSConditionRule
で取得・設定するデモを行います。
css
@media (min-width: 500px) {
body {
color: blue;
}
}
js
let myRules = document.styleSheets[0].cssRules;
let text = myRules[0].conditionText;
console.log(text); // "(min-width: 500px)"
text = "(min-width: 400px)";
console.log(text); // "(min-width: 400px)"
仕様書
Specification |
---|
CSS Conditional Rules Module Level 3 # dom-cssconditionrule-conditiontext |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
conditionText |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.