From 4a4ef1e9d69a81742b9ded7de60fff560ccb3b05 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Wed, 9 Mar 2022 01:58:35 +0900 Subject: 2021/08/13 時点の英語版に基づき新規翻訳 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/css/@property/inherits/index.md | 86 ++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 files/ja/web/css/@property/inherits/index.md diff --git a/files/ja/web/css/@property/inherits/index.md b/files/ja/web/css/@property/inherits/index.md new file mode 100644 index 0000000000..b3d28b5731 --- /dev/null +++ b/files/ja/web/css/@property/inherits/index.md @@ -0,0 +1,86 @@ +--- +title: inherits +slug: Web/CSS/@property/inherits +tags: + - CSS + - リファレンス + - ウェブ + - プロパティ + - Houdini +browser-compat: css.at-rules.property.inherits +translation_of: Web/CSS/@property/inherits +--- +{{CSSRef}}{{SeeCompatTable}} + +**`inherits`** は [CSS](/ja/docs/Web/CSS) の記述子で、 {{cssxref("@property")}} [アットルール](/ja/docs/Web/CSS/At-rule)を使用するときには必要であり、 `@property` で指定されたカスタムプロパティの登録を既定で継承するかどうかを制御します。 + +## 構文 + +```css +@property --property-name { + syntax: ''; + inherits: false; + initial-value: #c0ffee; +} + +@property --property-name { + syntax: ''; + inherits: true; + initial-value: #c0ffee; +} +``` + +## 値 + +- `true` + - : このプロパティは既定で継承されます。 +- `false` + - : このプロパティは既定で継承されません。 + +## 公式定義 + +{{cssinfo}} + +## 形式文法 + +{{csssyntax}} + +## 例 + +`--my-color` {{cssxref('--*', 'カスタムプロパティ')}}に色としての型チェックと、既定値、そして値が継承されないことを追加します。 + +[CSS](/ja/docs/Web/CSS) の {{cssxref('@property')}} [アットルール](/ja/docs/Web/CSS/At-rule)を使用すると次のようになります。 + +```css +@property --my-color { + syntax: ''; + inherits: false; + initial-value: #c0ffee; +} +``` + +[JavaScript](/ja/docs/Web/JavaScript) の {{domxref('CSS.registerProperty')}} を使用すると次のようになります。 + +```js +window.CSS.registerProperty({ + name: '--my-color', + syntax: '', + inherits: false, + initialValue: '#c0ffee', +}); +``` + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- [CSS プロパティと値 API](/ja/docs/Web/API/CSS_Properties_and_Values_API) +- [CSS 描画 API](/ja/docs/Web/API/CSS_Painting_API) +- [CSS 型付きオブジェクトモデル](/ja/docs/Web/API/CSS_Typed_OM_API) +- [CSS Houdini](/ja/docs/Web/Houdini) -- cgit v1.2.3-54-g00ecf