From a70e79de3a392914ce5aa790ce56295faed73141 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Mon, 3 Jan 2022 02:06:45 +0900 Subject: 擬似要素の文書を変換準備 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/css/_doublecolon_part/index.html | 126 -------------------------- files/ja/web/css/_doublecolon_part/index.md | 126 ++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 126 deletions(-) delete mode 100644 files/ja/web/css/_doublecolon_part/index.html create mode 100644 files/ja/web/css/_doublecolon_part/index.md (limited to 'files/ja/web/css/_doublecolon_part') diff --git a/files/ja/web/css/_doublecolon_part/index.html b/files/ja/web/css/_doublecolon_part/index.html deleted file mode 100644 index dc56b9e9b9..0000000000 --- a/files/ja/web/css/_doublecolon_part/index.html +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: '::part()' -slug: 'Web/CSS/::part' -tags: - - '::part' - - CSS - - Draft - - Experimental - - NeedsBrowserCompatibility - - NeedsExample - - Pseudo-element - - Reference - - Selector - - セレクター - - 擬似要素 -translation_of: 'Web/CSS/::part' ---- -
{{CSSRef}}
- -

::partCSS擬似要素で、一致する {{HTMLAttrxRef("part")}} 属性を持つシャドウツリー内の要素を表します。

- -
custom-element::part(foo) {
-  /* Styles to apply to the `foo` part */
-}
-
- -

構文

- -{{CSSSyntax}} - -

- -

HTML

- -
<template id="tabbed-custom-element">
-<style type="text/css">
-*, ::before, ::after {
-  box-sizing: border-box;
-  padding: 1rem;
-}
-:host {
-  display: flex;
-}
-</style>
-<div part="tab active">Tab 1</div>
-<div part="tab">Tab 2</div>
-<div part="tab">Tab 3</div>
-</template>
-
-<tabbed-custom-element></tabbed-custom-element>
- -

CSS

- -
tabbed-custom-element::part(tab) {
-  color: #0c0c0dcc;
-  border-bottom: transparent solid 2px;
-}
-
-tabbed-custom-element::part(tab):hover {
-  background-color: #0c0c0d19;
-  border-color: #0c0c0d33;
-}
-
-tabbed-custom-element::part(tab):hover:active {
-  background-color: #0c0c0d33;
-}
-
-tabbed-custom-element::part(tab):focus {
-  box-shadow:
-    0 0 0 1px #0a84ff inset,
-    0 0 0 1px #0a84ff,
-    0 0 0 4px rgba(10, 132, 255, 0.3);
-}
-
-tabbed-custom-element::part(active) {
-  color: #0060df;
-  border-color: #0a84ff !important;
-}
-
- -

JavaScript

- -
let template = document.querySelector("#tabbed-custom-element");
-globalThis.customElements.define(template.id, class extends HTMLElement {
-  constructor() {
-    super();
-    this.attachShadow({ mode: "open" });
-    this.shadowRoot.appendChild(template.content);
-  }
-});
-
- -

結果

- -

{{EmbedLiveSample('Examples')}}

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("CSS Shadow Parts", "#part", "::part")}}{{Spec2("CSS Shadow Parts")}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.selectors.part")}}

- -

関連情報

- - diff --git a/files/ja/web/css/_doublecolon_part/index.md b/files/ja/web/css/_doublecolon_part/index.md new file mode 100644 index 0000000000..dc56b9e9b9 --- /dev/null +++ b/files/ja/web/css/_doublecolon_part/index.md @@ -0,0 +1,126 @@ +--- +title: '::part()' +slug: 'Web/CSS/::part' +tags: + - '::part' + - CSS + - Draft + - Experimental + - NeedsBrowserCompatibility + - NeedsExample + - Pseudo-element + - Reference + - Selector + - セレクター + - 擬似要素 +translation_of: 'Web/CSS/::part' +--- +
{{CSSRef}}
+ +

::partCSS擬似要素で、一致する {{HTMLAttrxRef("part")}} 属性を持つシャドウツリー内の要素を表します。

+ +
custom-element::part(foo) {
+  /* Styles to apply to the `foo` part */
+}
+
+ +

構文

+ +{{CSSSyntax}} + +

+ +

HTML

+ +
<template id="tabbed-custom-element">
+<style type="text/css">
+*, ::before, ::after {
+  box-sizing: border-box;
+  padding: 1rem;
+}
+:host {
+  display: flex;
+}
+</style>
+<div part="tab active">Tab 1</div>
+<div part="tab">Tab 2</div>
+<div part="tab">Tab 3</div>
+</template>
+
+<tabbed-custom-element></tabbed-custom-element>
+ +

CSS

+ +
tabbed-custom-element::part(tab) {
+  color: #0c0c0dcc;
+  border-bottom: transparent solid 2px;
+}
+
+tabbed-custom-element::part(tab):hover {
+  background-color: #0c0c0d19;
+  border-color: #0c0c0d33;
+}
+
+tabbed-custom-element::part(tab):hover:active {
+  background-color: #0c0c0d33;
+}
+
+tabbed-custom-element::part(tab):focus {
+  box-shadow:
+    0 0 0 1px #0a84ff inset,
+    0 0 0 1px #0a84ff,
+    0 0 0 4px rgba(10, 132, 255, 0.3);
+}
+
+tabbed-custom-element::part(active) {
+  color: #0060df;
+  border-color: #0a84ff !important;
+}
+
+ +

JavaScript

+ +
let template = document.querySelector("#tabbed-custom-element");
+globalThis.customElements.define(template.id, class extends HTMLElement {
+  constructor() {
+    super();
+    this.attachShadow({ mode: "open" });
+    this.shadowRoot.appendChild(template.content);
+  }
+});
+
+ +

結果

+ +

{{EmbedLiveSample('Examples')}}

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("CSS Shadow Parts", "#part", "::part")}}{{Spec2("CSS Shadow Parts")}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("css.selectors.part")}}

+ +

関連情報

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