---
title: CSS Properties and Values API
slug: Web/API/CSS_Properties_and_Values_API
tags:
  - Houdini
translation_of: Web/API/CSS_Properties_and_Values_API
---
<p>CSS Properties and Values API(<a href="/ja/docs/Web/Houdini">CSS Houdini</a> API の傘の一部)を使用すると、開発者は {{cssxref('--*', 'CSS カスタムプロパティ')}}を明示的に定義して、プロパティ型のチェック、デフォルト値、および値を継承するまたは継承しないプロパティを許可できます。</p>

<h2 id="Interfaces" name="Interfaces">インターフェイス</h2>

<dl>
 <dt>{{domxref('CSS.registerProperty')}}</dt>
 <dd>ブラウザーが {{cssxref('--*', 'CSS カスタムプロパティ')}}を解析する方法を定義します。 JavaScript の  {{domxref('CSS.registerProperty')}} を介してこのインターフェイスにアクセスします。</dd>
 <dt>{{cssxref('@property')}}</dt>
 <dd>ブラウザーが {{cssxref('--*', 'CSS カスタムプロパティ')}}を解析する方法を定義します。 CSS の {{cssxref('@property')}} を介してこのインターフェイスにアクセスします。</dd>
</dl>

<dl>
</dl>

<h2 id="Examples" name="Examples">例</h2>

<p>次の例では、JavaScript で {{domxref('CSS.registerProperty')}} を使用して、{{cssxref('--*', 'CSS カスタムプロパティ')}} <code>--my-color</code> を色とし、デフォルト値を指定し、値を継承できないようにします。</p>

<pre class="brush: js notranslate">window.CSS.registerProperty({
  name: '--my-color',
  syntax: '&lt;color&gt;',
  inherits: false,
  initialValue: '#c0ffee',
});
</pre>

<p>次の {{cssxref('@property')}} を使用して、CSS で同じ登録を行うことができます。</p>

<pre class="brush: css notranslate">@property --my-color {
  syntax: '&lt;color&gt;';
  inherits: false;
  initial-value: #c0ffee;
}
</pre>

<h2 id="Specifications" name="Specifications">仕様</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">仕様</th>
   <th scope="col">状態</th>
   <th scope="col">コメント</th>
  </tr>
  <tr>
   <td>{{SpecName('CSS Properties and Values API')}}</td>
   <td>{{Spec2('CSS Properties and Values API')}}</td>
   <td>初期定義</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<p>個々のインターフェイスを参照</p>

<h2 id="See_Also" name="See_Also">関連情報</h2>

<ul>
 <li><a href="/ja/docs/Web/API/CSS_Properties_and_Values_API/guide">CSS properties and values API の使用</a></li>
 <li><a href="/ja/docs/Web/API/CSS_Painting_API">CSS Painting API</a></li>
 <li><a href="/ja/docs/Web/API/CSS_Typed_OM_API">CSS Typed Object Model</a></li>
 <li><a href="/ja/docs/Web/Houdini">CSS Houdini</a></li>
</ul>