From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../getpropertycssvalue/index.html | 65 +++++++++++ .../getpropertyvalue/index.html | 67 ++++++++++++ files/ja/web/api/cssstyledeclaration/index.html | 121 +++++++++++++++++++++ 3 files changed, 253 insertions(+) create mode 100644 files/ja/web/api/cssstyledeclaration/getpropertycssvalue/index.html create mode 100644 files/ja/web/api/cssstyledeclaration/getpropertyvalue/index.html create mode 100644 files/ja/web/api/cssstyledeclaration/index.html (limited to 'files/ja/web/api/cssstyledeclaration') diff --git a/files/ja/web/api/cssstyledeclaration/getpropertycssvalue/index.html b/files/ja/web/api/cssstyledeclaration/getpropertycssvalue/index.html new file mode 100644 index 0000000000..f3ce66652d --- /dev/null +++ b/files/ja/web/api/cssstyledeclaration/getpropertycssvalue/index.html @@ -0,0 +1,65 @@ +--- +title: CSSStyleDeclaration.getPropertyCSSValue() +slug: Web/API/CSSStyleDeclaration/getPropertyCSSValue +tags: + - API + - CSSOM + - Method + - Obsolete + - Reference +translation_of: Web/API/CSSStyleDeclaration/getPropertyCSSValue +--- +

{{ APIRef("CSSOM") }} {{Obsolete_header}}

+ +

CSSStyleDeclaration.getPropertyCSSValue() メソッドインターフェイスは、プロパティの CSS 値を含む {{domxref('CSSValue')}} を返します。 プロパティ名が省略プロパティの場合は null を返すことに注意して下さい。

+ +

代わりに {{domxref("CSSStyleDeclaration.getPropertyValue()")}} を使用する必要があります。

+ +

構文

+ +
var value = style.getPropertyCSSValue(property);
+ +

パラメータ

+ + + +

返り値

+ + + +

+ +

次の JavaScript コードは、 color CSS プロパティの計算された RGB 値を含むオブジェクトを取得します:

+ +
var style = window.getComputedStyle(elem, null);
+var rgbObj = style.getPropertyCSSValue('color').getRGBColorValue();
+
+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様ステータス備考
{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}{{Spec2('DOM2 Style')}}2003年7月に廃止と宣言
+ +

ブラウザー実装状況

+ + + +

{{Compat("api.CSSStyleDeclaration.getPropertyCSSValue")}}

diff --git a/files/ja/web/api/cssstyledeclaration/getpropertyvalue/index.html b/files/ja/web/api/cssstyledeclaration/getpropertyvalue/index.html new file mode 100644 index 0000000000..feb4705491 --- /dev/null +++ b/files/ja/web/api/cssstyledeclaration/getpropertyvalue/index.html @@ -0,0 +1,67 @@ +--- +title: CSSStyleDeclaration.getPropertyValue() +slug: Web/API/CSSStyleDeclaration/getPropertyValue +tags: + - API + - CSSOM + - Method + - Reference +translation_of: Web/API/CSSStyleDeclaration/getPropertyValue +--- +

{{ APIRef("CSSOM") }}

+ +

CSSStyleDeclaration.getPropertyValue() メソッドインターフェイスは、指定された CSS プロパティの値を含む {{domxref('DOMString')}} を返します。

+ +

構文

+ +
var value = style.getPropertyValue(property);
+ +

パラメータ

+ + + +

返り値

+ + + +

+ +

次の JavaScript コードは CSS セレクタールールの margin プロパティの値をクエリします:

+ +
var declaration = document.styleSheets[0].cssRules[0].style;
+var value = declaration.getPropertyValue('margin'); // "1px 2px"
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + + + +
仕様ステータス備考
{{SpecName('CSSOM', '#dom-cssstyledeclaration-getpropertyvalue', 'CSSStyleDeclaration.getPropertyValue()')}}{{Spec2('CSSOM')}}
{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}{{Spec2('DOM2 Style')}}
+ +

ブラウザー実装状況

+ + + +

{{Compat("api.CSSStyleDeclaration.getPropertyValue")}}

diff --git a/files/ja/web/api/cssstyledeclaration/index.html b/files/ja/web/api/cssstyledeclaration/index.html new file mode 100644 index 0000000000..7055ef0943 --- /dev/null +++ b/files/ja/web/api/cssstyledeclaration/index.html @@ -0,0 +1,121 @@ +--- +title: CSSStyleDeclaration +slug: Web/API/CSSStyleDeclaration +translation_of: Web/API/CSSStyleDeclaration +--- +
{{APIRef("CSSOM")}}
+ +

CSSStyleDeclarationインターフェースはCSS宣言ブロックオブジェクトを表し、スタイル情報やスタイル関連のメソッド、プロパティを提供します。

+ +

CSSStyleDeclaration オブジェクトは下記の3つのAPIによって使用されます。

+ + + +

属性

+ +
+
{{DOMxRef("CSSStyleDeclaration.cssText")}}
+
Textual representation of the declaration block. Setting this attribute changes the style.
+ CSSブロック宣言をテキスト表示する。この属性を与えることでスタイルを変化させることが可能。
+
{{DOMxRef("CSSStyleDeclaration.length")}}{{ReadOnlyInline}}
+
プロパティの数を表す。後述の{{DOMxRef("CSSStyleDeclaration.item()", 'item()')}}メソッドを参照のこと。
+  
+
{{DOMxRef("CSSStyleDeclaration.parentRule")}}{{ReadOnlyInline}}
+
{{DOMxRef("CSSRule")}}を含むコンテナを表す。
+
+ +

CSS プロパティ

+ +
+
{{DOMxRef("CSSStyleDeclaration.named_properties", "CSSStyleDeclaration.cssFloat")}}
+
{{CSSxRef("float")}} CSSプロパティのエイリアス。
+
{{DOMxRef("CSSStyleDeclaration.named_properties", 'CSSStyleDeclaration named properties', "", 1)}}
+
全てのCSSプロパティに対して、その値を取得する。
+
+ +

メソッド

+ +
+
{{DOMxRef("CSSStyleDeclaration.getPropertyPriority()")}}
+
Returns the optional priority, "important".
+
{{DOMxRef("CSSStyleDeclaration.getPropertyValue()")}}
+
Returns the property value given a property name.
+
{{DOMxRef("CSSStyleDeclaration.item()")}}
+
Returns a CSS property name by its index, or the empty string if the index is out-of-bounds.
+
An alternative to accessing nodeList[i] (which instead returns undefined when i is out-of-bounds). This is mostly useful for non-JavaScript DOM implementations.
+
{{DOMxRef("CSSStyleDeclaration.removeProperty()")}}
+
Removes a property from the CSS declaration block.
+
{{DOMxRef("CSSStyleDeclaration.setProperty()")}}
+
Modifies an existing CSS property or creates a new CSS property in the declaration block.
+
{{DOMxRef("CSSStyleDeclaration.getPropertyCSSValue()")}} {{Obsolete_Inline}}
+
Only supported via getComputedStyle in Firefox. Returns the property value as a {{DOMxRef("CSSPrimitiveValue")}} or null for shorthand properties.
+
+ +

+ +
var styleObj = document.styleSheets[0].cssRules[0].style;
+console.log(styleObj.cssText);
+
+for (var i = styleObj.length; i--;) {
+  var nameString = styleObj[i];
+  styleObj.removeProperty(nameString);
+}
+
+console.log(styleObj.cssText);
+ +

仕様

+ + + + + + + + + + + + + + + + + + + + + +
仕様ステータスコメント
{{SpecName('CSSOM', '#the-cssstyledeclaration-interface', 'CSSStyleDeclaration')}}{{Spec2('CSSOM')}}Merged the DOM Level 2 Style CSS2Properties interface into CSSStyleDeclaration.
{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}{{Spec2('DOM2 Style')}}Initial definition
+ +

ブラウザー実装状況

+ + + +

{{Compat("api.CSSStyleDeclaration")}}

+ +

関連情報

+ + + +
+
+
+
+ +
+ +
+
+ +
+
+
-- cgit v1.2.3-54-g00ecf