From a8026efcd3bbf9ac82b6dc432fb5b5ea08af3126 Mon Sep 17 00:00:00 2001
From: Masahiro FUJIMOTO 色はプロパティ値のスコープにある装飾、すなわち下線、上線、打消し線、それにスペルミスに印をつけるために使われるような波線などに適用されます。 CSS はそれぞれの線種ごとに固有の色を指定する仕組みを直接は持っていません。しかしながら、この効果は要素を入れ子にして、それぞれの要素毎に ({{cssxref("text-decoration-line")}} プロパティで) 異なる線種を適用し、 (code>text-decoration-color で) 線の色を指定することで実現できます。 テキストの色、テキストが置かれている背景、テキストの装飾線の間のコントラスト比が、弱視の人がページの内容を読むことができるように十分に高いことを確認ことが重要です。色のコントラスト比は、テキストと背景の色の輝度を比較して決定されます。 色だけで意味を伝えるべきではありません。例えば、テキストの色と text-decoration-color の変更だけでは、リンクにフォーカスがあることを示すのに十分ではありません。 {{CSSInfo}} This paragraph has {{ EmbedLiveSample('Examples') }} {{Compat}} CSS の このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 https://github.com/mdn/interactive-examples をクローンしてプルリクエストを送信してください。 複数の line-decoration に関するプロパティを一度に設定するときは、代わりに一括指定の {{cssxref("text-decoration")}} プロパティを使用したほうが便利かもしれません。 こちらのテキストには赤い波線の下線が付いています。 このテキストには上線と下線がついています。 {{ EmbedLiveSample('Examples', '', '', '') }} {{cssinfo}} {{Compat("css.properties.text-decoration-line")}} CSS の このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 https://github.com/mdn/interactive-examples をクローンしてプルリクエストを送信してください。 You should go on a quest for a cup of coffee. Or maybe you'd prefer some tea? この文は、 text-decoration-skip-ink: auto の使用例を示しています。 この文は、 text-decoration-skip-ink: all の使用例を示しています。 {{EmbedLiveSample("Examples", "100%", 250)}} {{cssinfo}} {{Compat("css.properties.text-decoration-skip-ink")}} CSS の このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 https://github.com/mdn/interactive-examples をクローンしてプルリクエストを送信してください。 文字列を貫く線で文字列が削除されたことを示すように、指定された装飾が特定の意味を持つ場合は、 {{HTMLElement("del")}} や {{HTMLElement("s")}} といった HTML タグでその意味を示すことが推奨されます。ブラウザーはスタイルを無効にする場合がありますが、そのようなときでも意味論上の意味が失われません。 線の装飾に関する複数のプロパティを一度に設定するときは、代わりに一括指定の {{cssxref("text-decoration")}} プロパティを使用したほうが便利かもしれません。 このテキストには付近に赤い波線があります。 {{ EmbedLiveSample('Examples', '', '', '') }} {{cssinfo}} {{Compat("css.properties.text-decoration-style")}} {{CSSInfo}} 赤い 1px の下線を引いたテキストです。 赤い 5px の下線を引いたテキストです。 これは同等の一括指定を使用しています。 {{ EmbedLiveSample('Varying_thickness', '', '', '') }} 注: このプロパティは {{Compat("css.properties.text-decoration-thickness")}} 文字列の装飾は、子孫の文字列要素に適用されます。つまり、要素に文字列装飾が指定されれば、子要素では装飾を外すことができません。例えば、 This text has some emphasized words in it. このプロパティは以下の CSS プロパティの一括指定です。 {{CSSInfo}} This text has a line underneath it. This text has a line over it. This text has a line going through it. This link will not be underlined,
as links generally are by default. Be careful when removing
the text decoration on anchors since users often depend on
- the underline to denote hyperlinks.</p>
-<p class="underover">This text has lines above <em>and</em> below it.</p>
-<p class="thick">This text has a really thick purple underline in supporting browsers.</p>
-<p class="blink">This text might blink for you,
- depending on the browser you use.</p>
- {{EmbedLiveSample('Examples','auto','320')}} {{Compat("css.properties.text-decoration")}}text-decoration-color は CSS のプロパティで、 {{ cssxref("text-decoration-line") }} でテキストに追加された装飾の色を設定します。構文
-
-/* <color> 値 */
+```css
+/*
+```
-値
+### 値
-
-
+- {{cssxref("<color>")}}
+ - : 装飾線の色です。
-アクセシビリティの考慮
+## アクセシビリティの考慮
-
-
+- [WebAIM: Color Contrast Checker](https://webaim.org/resources/contrastchecker/)
+- [MDN "WCAG を理解する ― ガイドライン 1.4 の解説"](/ja/docs/Web/Accessibility/Understanding_WCAG/Perceivable#guideline_1.4_make_it_easier_for_users_to_see_and_hear_content_including_separating_foreground_from_background)
+- [Understanding Success Criterion 1.4.3 | W3C Understanding WCAG 2.0](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html)
-公式定義
+## 公式定義
-形式文法
+## 形式文法
{{csssyntax}}
例
-基本的な例
+### 基本的な例
-<p>This paragraph has <s>some erroneous text</s>
- inside it that I want to call attention to.</p>
+```html
+some erroneous text
+ inside it that I want to call attention to.p {
+```css
+p {
text-decoration-line: underline;
text-decoration-color: cyan;
}
@@ -87,23 +86,22 @@ s {
text-decoration-line: line-through;
text-decoration-color: red;
text-decoration-style: wavy;
-}
+}
+```
-仕様書
+## 仕様書
{{Specifications}}
-ブラウザーの互換性
+## ブラウザーの互換性
-関連情報
+## 関連情報
-
-
+- 複数の行内装飾プロパティを一度に設定するときは、代わりに一括指定の {{cssxref("text-decoration")}} プロパティを使った方が便利かもしれません。
+- {{cssxref("<color>")}} データ型
+- 色に関する他のプロパティ: {{cssxref("background-color")}}, {{cssxref("border-color")}}, {{cssxref("outline-color")}}, {{cssxref("text-decoration-color")}}, {{cssxref("text-emphasis-color")}}, {{cssxref("text-shadow")}}, {{cssxref("caret-color")}}, {{cssxref("column-rule-color")}}
+- [CSS を使用した HTML 要素への色の適用](/ja/docs/Web/HTML/Applying_color)
diff --git a/files/ja/web/css/text-decoration-line/index.md b/files/ja/web/css/text-decoration-line/index.md
index b64e8c68c1..37387415f4 100644
--- a/files/ja/web/css/text-decoration-line/index.md
+++ b/files/ja/web/css/text-decoration-line/index.md
@@ -3,24 +3,25 @@ title: text-decoration-line
slug: Web/CSS/text-decoration-line
tags:
- CSS
- - CSS テキスト装飾
- CSS プロパティ
+ - CSS テキスト装飾
- Reference
+ - recipe:css-property
+browser-compat: css.properties.text-decoration-line
translation_of: Web/CSS/text-decoration-line
---
-text-decoration-line プロパティは、下線や上線など、要素内の文字列に使われる装飾の種類を設定します。構文
-
-/* 単一のキーワード */
+```css
+/* 単一のキーワード */
text-decoration-line: none;
text-decoration-line: underline;
text-decoration-line: overline;
@@ -28,42 +29,50 @@ text-decoration-line: line-through;
text-decoration-line: blink;
/* 複数のキーワード */
-text-decoration-line: underline overline; /* 2つの装飾線 */
+text-decoration-line: underline overline; /* 2 つの装飾線 */
text-decoration-line: overline underline line-through; /* 複数の装飾線 */
/* グローバル値 */
text-decoration-line: inherit;
text-decoration-line: initial;
+text-decoration-line: revert;
text-decoration-line: unset;
-
+```
+
+`text-decoration-line` プロパティは `none` または以下のリストにある **1 つ以上の**空白で区切られた値を指定します。
-text-decoration-line プロパティは none または以下のリストにある1つ以上の空白で区切られた値を指定します。値
+- `none`
+ - : テキストの装飾を行いません。
+- `underline`
+ - : テキストの各行に下線を引きます。
+- `overline`
+ - : テキストの各行の上線を引きます。
+- `line-through`
+ - : テキストの各行の中央を貫く線を引きます。
+- `blink` {{deprecated_inline}}
+ - : テキストが点滅します (表示と非表示を交互に繰り返します)。準拠するユーザーエージェントはテキストを点滅させないかもしれません。この値は**非推奨**であり、 [CSS アニメーション](/ja/docs/Web/CSS/animation)に取って代わりました。
-
-
+## 公式定義
-noneunderlineoverlineline-throughblink {{deprecated_inline}}形式文法
+{{CSSInfo}}
+
+## 形式文法
{{csssyntax}}
-例
+例
+
+### 基本的な例
-<p class="wavy">Here's some text with wavy red underline!</p>
-<p class="both">This text has lines both above and below it.</p>
+```html
+.wavy {
+```css
+.wavy {
text-decoration-line: underline;
text-decoration-style: wavy;
text-decoration-color: red;
@@ -71,37 +80,19 @@ text-decoration-line: unset;
.both {
text-decoration-line: underline overline;
-}
-
-仕様書
+{{ EmbedLiveSample('Examples', '', '', '') }}
-
-
-
+## 仕様書
-
-
-
-
- 仕様書
- 状態
- 備考
-
-
-
-{{SpecName('CSS3 Text Decoration', '#text-decoration-line', 'text-decoration-line')}}
- {{Spec2('CSS3 Text Decoration')}}
- 初回定義。 {{cssxref("text-decoration")}} プロパティが複数の関連するプロパティを定義する一括指定になりました。
- ブラウザーの対応
+## ブラウザーの互換性
-関連情報
+## 関連情報
-
-
+- 複数の行内装飾プロパティを一度に設定するときは、代わりに一括指定の {{cssxref("text-decoration")}} プロパティを使った方が便利かもしれません。
diff --git a/files/ja/web/css/text-decoration-skip-ink/index.md b/files/ja/web/css/text-decoration-skip-ink/index.md
index 587f6629c7..26a2734684 100644
--- a/files/ja/web/css/text-decoration-skip-ink/index.md
+++ b/files/ja/web/css/text-decoration-skip-ink/index.md
@@ -3,29 +3,29 @@ title: text-decoration-skip-ink
slug: Web/CSS/text-decoration-skip-ink
tags:
- CSS
- - CSS テキスト装飾
- CSS プロパティ
+ - CSS テキスト装飾
- Experimental
+ - レイアウト
- Reference
- Web
+ - recipe:css-property
- text-decoration-skip-ink
- - ウェブ
- - レイアウト
+browser-compat: css.properties.text-decoration-skip-ink
translation_of: Web/CSS/text-decoration-skip-ink
---
-text-decoration-skip-ink プロパティは、上線や下線が文字のアセンダーやディセンダーを通過するときにどのように引くのかを指定します。text-decoration-skip-ink は {{cssxref("text-decoration")}} 一括指定の一部ではありません。構文
+## 構文
-/* 単一キーワード */
+```css
+/* 単一キーワード */
text-decoration-skip-ink: none;
text-decoration-skip-ink: auto;
text-decoration-skip-ink: all;
@@ -33,38 +33,45 @@ text-decoration-skip-ink: all;
/* グローバルキーワード */
text-decoration-skip: inherit;
text-decoration-skip: initial;
+text-decoration-skip-ink: revert;
text-decoration-skip: unset;
-
+```
-値
+### 値
-
-
+- `none`
+ - : 下線と上線は、アセンダーとディセンダーの部分を含め、テキストコンテンツの全体に渡って引かれます。
+- `auto`
+ - : 既定値です。 — ブラウザーは、下線と上線が文字に触れたり近づいたりしないよう、中断を行う*可能性があります*。つまり、線が文字を横切ろうとするところで中断されます。
+- `all`
-noneautoallauto の動作が中断を発生させない可能性がある中国語、日本語、韓国語の特定のフォントで有用です。
形式文法
+ - : ブラウザーは、下線や上線が文字に触れたり近づいたりしないように*必ず*中断を行います。これは、 `auto` の動作が中断を発生させない可能性がある中国語、日本語、韓国語の特定のフォントで有用です。
+
+ 
+
+## 公式定義
+
+{{CSSInfo}}
+
+## 形式文法
{{csssyntax}}
-例
+例
-HTML
+### HTML
-<p>You should go on a quest for a cup of coffee.</p>
-<p class="no-skip-ink">Or maybe you'd prefer some tea?</p>
-<p>この文は、 text-decoration-skip-ink: auto の使用例を示しています。</p>
-<p class="skip-ink-all">この文は、 text-decoration-skip-ink: all の使用例を示しています。</p>
-
+```html
+CSS
+### CSS
-p {
+```css
+p {
font-size: 1.5em;
text-decoration: underline blue;
text-decoration-skip-ink: auto; /* this is the default anyway */
@@ -77,40 +84,21 @@ text-decoration-skip: unset;
.skip-ink-all{
text-decoration-skip-ink: all;
}
-
-
-結果
+```
-仕様書
+{{EmbedLiveSample("Examples", "100%", 250)}}
-
-
-
+## 仕様書
-
-
-
-
- 仕様書
- 状態
- 備考
-
-
-
-{{SpecName("CSS4 Text Decoration", "#text-decoration-skip-ink-property", "text-decoration-skip-ink")}}
- {{Spec2("CSS4 Text Decoration")}}
- 初回定義
- ブラウザーの互換性
+## ブラウザーの互換性
-関連情報
+## 関連情報
-
-
+- {{cssxref('text-decoration')}}
+- {{cssxref('text-decoration-skip')}}
diff --git a/files/ja/web/css/text-decoration-style/index.md b/files/ja/web/css/text-decoration-style/index.md
index 76e20dd2f2..c57688cb8f 100644
--- a/files/ja/web/css/text-decoration-style/index.md
+++ b/files/ja/web/css/text-decoration-style/index.md
@@ -3,28 +3,28 @@ title: text-decoration-style
slug: Web/CSS/text-decoration-style
tags:
- CSS
- - CSS テキスト装飾
- CSS プロパティ
- - Layout
- - Reference
+ - CSS テキスト装飾
- レイアウト
+ - Reference
+ - recipe:css-property
+browser-compat: css.properties.text-decoration-style
translation_of: Web/CSS/text-decoration-style
---
-text-decoration-style プロパティは、 {{ cssxref("text-decoration-line") }} で指定された線の種類を設定します。線の種類はすべての線に適用され text-decoration-line で定義された線ごとに異なる種類を定義する方法はありません。構文
-
-/* キーワード値 */
+```css
+/* キーワード値 */
text-decoration-style: solid;
text-decoration-style: double;
text-decoration-style: dotted;
@@ -34,80 +34,76 @@ text-decoration-style: wavy;
/* グローバル値 */
text-decoration-style: inherit;
text-decoration-style: initial;
+text-decoration-style: revert;
text-decoration-style: unset;
-
-
-値
-
-
-
-
-: none を使用してください。形式文法
+```
+
+### 値
+
+- solid
+ - : 単独線を描画します。
+- double
+ - : 二重線を描画します。
+- dotted
+ - : 点線を描画します。
+- dashed
+ - : 破線を描画します。
+- wavy
+ - : 波線を描画します。
+- \-moz-none{{ non-standard_inline }}
+ - : 線を描画しません。代わりに {{ cssxref("text-decoration-line") }}`: none` を使用してください。
+
+## 公式定義
+
+{{CSSInfo}}
+
+## 形式文法
{{csssyntax}}
-例
+## Examples
+
+波線の下線を設定
-.example {
+```css
+.example {
-moz-text-decoration-line: underline;
-moz-text-decoration-style: wavy;
-moz-text-decoration-color: red;
-webkit-text-decoration-line: underline;
-webkit-text-decoration-style: wavy;
-webkit-text-decoration-color: red;
-}
+}
+```
+
+#### CSS
-.wavy {
+```css
+.wavy {
text-decoration-line: underline;
text-decoration-style: wavy;
text-decoration-color: red;
}
-
+```
+
+#### HTML
-<p class="wavy">This text has a wavy red line beneath it.</p>
-
+```html
+仕様書
+{{ EmbedLiveSample('Setting_a_wavy_underline', '', '', '') }}
-
-
-
+## 仕様書
-
-
-
-
- 仕様書
- 状態
- 備考
-
-
-
-{{ SpecName('CSS3 Text Decoration', '#text-decoration-style', 'text-decoration-style') }}
- {{ Spec2('CSS3 Text Decoration') }}
- 初回定義。 {{cssxref("text-decoration")}} プロパティが複数の関連するプロパティを定義するための一括指定になりました。
- ブラウザーの対応
+## ブラウザーの互換性
-関連情報
+## 関連情報
-
-
+- 複数の行内装飾プロパティを一度に設定するときは、代わりに一括指定の {{cssxref("text-decoration")}} プロパティを使った方が便利かもしれません。
diff --git a/files/ja/web/css/text-decoration-thickness/index.md b/files/ja/web/css/text-decoration-thickness/index.md
index 63fcce1a71..b2d8586caf 100644
--- a/files/ja/web/css/text-decoration-thickness/index.md
+++ b/files/ja/web/css/text-decoration-thickness/index.md
@@ -3,21 +3,23 @@ title: text-decoration-thickness
slug: Web/CSS/text-decoration-thickness
tags:
- CSS
- - CSS Text Decoration
- - Property
+ - CSS テキスト装飾
+ - プロパティ
- Reference
- - 'recipe:css-property'
+ - recipe:css-property
- text-decoration
- text-decoration-thickness
+browser-compat: css.properties.text-decoration-thickness
translation_of: Web/CSS/text-decoration-thickness
---
-text-decoration-thickness は CSS のプロパティで、要素内のテキストに用いられる装飾線、例えば取り消し線、下線、上線の太さを設定します。構文
+## 構文
-/* 単独のキーワード */
+```css
+/* 単独のキーワード */
text-decoration-thickness: auto;
text-decoration-thickness: from-font;
@@ -31,43 +33,45 @@ text-decoration-thickness: 10%;
/* グローバル値 */
text-decoration-thickness: inherit;
text-decoration-thickness: initial;
+text-decoration-thickness: revert;
text-decoration-thickness: unset;
-
+```
-値
+### 値
-
-
+- `auto`
+ - : ブラウザーがテキスト装飾線の適切な太さを選択します。
+- `from-font`
+ - : フォントファイルに推奨する太さの情報が含まれている場合は、その値を使用します。フォントファイルにこの情報が含まれていない場合は、 `auto` が設定されているのと同様に動作し、ブラウザーが適切な太さを選択します。
+- `autofrom-fontauto が設定されているのと同様に動作し、ブラウザーが適切な太さを選択します。<length><percentage>公式定義
+## 公式定義
-形式文法
+## 形式文法
{{csssyntax}}
-例
+## Examples
様々な太さ
-HTML
+#### HTML
-<p class="thin">赤い 1px の下線を引いたテキストです。</p>
-<p class="thick">赤い 5px の下線を引いたテキストです。</p>
-<p class="shorthand">これは同等の一括指定を使用しています。</p>
+```html
+CSS
+#### CSS
-.thin {
+```css
+.thin {
text-decoration-line: underline;
text-decoration-style: solid;
text-decoration-color: red;
@@ -83,42 +87,24 @@ text-decoration-thickness: unset;
.shorthand {
text-decoration: underline solid red 5px;
-}
+}
+```
-結果
+#### Results
-仕様書
+## 仕様書
-
-
-
+{{Specifications}}
-
-
-
-
- 仕様書
- 状態
- 備考
-
-
-
-{{SpecName('CSS4 Text Decoration', '#text-decoration-width-property', 'text-decoration-width')}}
- {{Spec2('CSS4 Text Decoration')}}
- 初回定義
- text-decoration-width と呼ばれていましたが、 2019 年に text-decoration-thickness に更新されました。ブラウザーの互換性
+## ブラウザーの互換性
-関連情報
+## 関連情報
-
-
+- {{cssxref("text-decoration")}}
+- {{cssxref("text-underline-offset")}}
diff --git a/files/ja/web/css/text-decoration/index.md b/files/ja/web/css/text-decoration/index.md
index 8e77aba241..4f93ab28ee 100644
--- a/files/ja/web/css/text-decoration/index.md
+++ b/files/ja/web/css/text-decoration/index.md
@@ -6,62 +6,68 @@ tags:
- CSS Property
- CSS Text Decoration
- Reference
- - 'recipe:css-shorthand-property'
- - text-decoration
- - text-decoration-color
- - text-decoration-line
- - text-decoration-style
+ - recipe:css-shorthand-property
+browser-compat: css.properties.text-decoration
translation_of: Web/CSS/text-decoration
---
-text-decoration は CSS の 一括指定プロパティで、テキストの装飾的な線の表示を設定します。これは {{cssxref("text-decoration-line")}}, {{cssxref("text-decoration-color")}}, {{cssxref("text-decoration-style")}} およびさらに新しい {{cssxref("text-decoration-thickness")}} プロパティの一括指定です。<p>This text has <em>some emphasized words</em> in it.</p> というマークアップと、 p { text-decoration: underline; } のスタイル規則では、段落全体に下線が引かれます。 em { text-decoration: none; } のスタイル規則を適用しても変化せず、段落全体に下線が引かれたままになります。しかし、 em { text-decoration: overline; } の規則で "some emphasized words" に第二の装飾が施されます。構成要素のプロパティ
+## 構成要素のプロパティ
-
-
+- [`text-decoration-color`](/ja/docs/Web/CSS/text-decoration-color)
+- [`text-decoration-line`](/ja/docs/Web/CSS/text-decoration-line)
+- [`text-decoration-style`](/ja/docs/Web/CSS/text-decoration-style)
+- [`text-decoration-thickness`](/ja/docs/Web/CSS/text-decoration-thickness)
-text-decoration-colortext-decoration-linetext-decoration-styletext-decoration-thickness構文
+## 構文
-text-decoration プロパティは、個別指定の text-decoration プロパティを表す 1 つまたは複数の値を空白で区切って指定します。値
+/* グローバル値 */
+text-decoration: inherit;
+text-decoration: initial;
+text-decoration: revert;
+text-decoration: unset;
+```
-
-
+`text-decoration` プロパティは、個別指定の text-decoration プロパティを表す 1 つまたは複数の値を空白で区切って指定します。
-underline や line-through などです。solid, wavy, dashed などです。公式定義
+### 値
-形式文法
+## 公式定義
+
+{{CSSInfo}}
+
+## 形式文法
{{csssyntax}}
例
-text-decoration の値のデモ
+### text-decoration の値のデモ
-.under {
+```css
+.under {
text-decoration: underline red;
}
@@ -88,64 +94,33 @@ translation_of: Web/CSS/text-decoration
.blink {
text-decoration: blink;
}
-
+```
-<p class="under">This text has a line underneath it.</p>
-<p class="over">This text has a line over it.</p>
-<p class="line">This text has a line going through it.</p>
-<p>This <a class="plain" href="#">link will not be underlined</a>,
+```html
+
-
-仕様書
-
-
-
-
-
-
-
-
-
- 仕様書
- 状態
- 備考
-
-
- {{SpecName('CSS4 Text Decoration')}}
- {{Spec2('CSS4 Text Decoration')}}
- {{cssxref("text-decoration-thickness")}} を追加。なお、これはまだ公式には一括指定の一部ではありません。これはまだ未定義です。
-
-
- {{SpecName('CSS3 Text Decoration', '#text-decoration-property', 'text-decoration')}}
- {{Spec2('CSS3 Text Decoration')}}
- 一括指定プロパティへ変更。 {{cssxref('text-decoration-style')}} の値への対応を追加。
-
-
- {{SpecName('CSS2.1', 'text.html#lining-striking-props', 'text-decoration')}}
- {{Spec2('CSS2.1')}}
- 実質的な変更なし。
-
-
-
-{{SpecName('CSS1', '#text-decoration', 'text-decoration')}}
- {{Spec2('CSS1')}}
- 初回定義
- ブラウザーの互換性
-
-関連情報
-
-
-
+ the underline to denote hyperlinks.
This text has lines above and below it.
+This text has a really thick purple underline in supporting browsers.
+This text might blink for you, + depending on the browser you use.
+``` + +{{EmbedLiveSample('Examples','auto','320')}} + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- text-decoration の個別指定プロパティは、 {{cssxref("text-decoration-line")}}、{{cssxref("text-decoration-color")}}、{{cssxref("text-decoration-style")}} です。 +- {{cssxref("list-style")}} 属性は HTML の {{HTMLElement("ol")}} および {{HTMLElement("ul")}} のリストの表示方法を制御します。 diff --git a/files/ja/web/css/text-emphasis-color/index.md b/files/ja/web/css/text-emphasis-color/index.md index 44da77376c..2071d50a60 100644 --- a/files/ja/web/css/text-emphasis-color/index.md +++ b/files/ja/web/css/text-emphasis-color/index.md @@ -3,26 +3,27 @@ title: text-emphasis-color slug: Web/CSS/text-emphasis-color tags: - CSS + - CSS プロパティ - CSS スタイル - CSS テキスト装飾 - - CSS プロパティ - HTML 色 - Reference - - Styling HTML - - Text Emphasis - - 'recipe:css-property' + - HTML のスタイル付け + - テキストの強調 + - recipe:css-property - text-decoration-color browser-compat: css.properties.text-emphasis-color translation_of: Web/CSS/text-emphasis-color --- -text-emphasis-color は CSS のプロパティで、圏点の色を設定します。この値は一括指定の {{cssxref("text-emphasis")}} を使用して設定することもできます。
/* 初期値 */ +```css +/* 初期値 */ text-emphasis-color: currentcolor; -/* <color> */ +/*+``` -*/ text-emphasis-color: #555; text-emphasis-color: blue; text-emphasis-color: rgba(90, 200, 160, 0.8); @@ -33,60 +34,61 @@ text-emphasis-color: inherit; text-emphasis-color: initial; text-emphasis-color: revert; text-emphasis-color: unset; -
<color>currentcolor になります。{{CSSInfo}}
+{{CSSInfo}} -em {
+```css
+em {
+ -webkit-text-emphasis-color: green;
text-emphasis-color: green;
+ -webkit-text-emphasis-style: "*";
text-emphasis-style: "*";
-}
+}
+```
-<p>Here's an example:</p> +```html ++これには圏点があります! +``` -例:
-<em>This has emphasis marks!</em> -
{{EmbedLiveSample("Emphasis_with_a_color_and_custom_character", 450, 100)}}
+{{EmbedLiveSample("Emphasis_with_a_color_and_custom_character", 450, 100)}} -{{Compat}}
+{{Compat}} -CSS の text-emphasis-position プロパティは、圏点が描かれる位置を設定します。ルビテキストと同様、圏点のために十分な空間がない場合は、行の高さが広げられます。
/* 初期値 */ +```css +/* 初期値 */ text-emphasis-position: over right; /* キーワード値 */ @@ -27,115 +30,129 @@ text-emphasis-position: left under; /* グローバル値 */ text-emphasis-position: inherit; text-emphasis-position: initial; +text-emphasis-postition: revert; text-emphasis-position: unset; -+``` + +## 構文 -
{{cssinfo}}
+### 値 -圏点の望ましい位置は言語に依存します。例えば日本語では、望ましい位置は over right です。一方中国語では、望ましい位置は under right となります。下記の情報の表は、日本語、モンゴル語、中国語における望ましい圏点の位置を要約するものです。
+## Description + +圏点の望ましい位置は言語に依存します。例えば日本語では、望ましい位置は `over right` です。一方、中国語では、望ましい位置は `under right` となります。下記の情報の表は、日本語、モンゴル語、中国語における望ましい圏点の位置をまとめたものです。| 言語 | -望ましい位置 | -説明 | -||
|---|---|---|---|---|
| 横書き | -縦書き | -|||
| 日本語 | -over | -right | -![]() |
- ![]() |
-
| モンゴル語 | -||||
| 中国語 | -under | -right | -![]() |
- |
| 言語 | +望ましい位置 | +図 | +||
| 横書き | +縦書き | +|||
| 日本語 | +over | +right | +
+
+ |
+
+
+ |
+
| 韓国語 | +||||
| モンゴル語 | +||||
| 中国語 | +under | +right | +
+
+ |
+ |
メモ: {{cssxref("text-emphasis")}} 一括指定プロパティを使用して、 text-emphasis-position を設定することはできず、また初期化されることもありません。
overunderrightleft編集者によっては、ルビと競合する場合に圏点を隠すことを好みます。 HTML では、これは次のスタイル規則で実現できます。
+編集者によっては、ルビと競合する場合に圏点を隠すことを好みます。 HTML では、これは次のスタイル規則で実現できます。 -ruby {
+```css
+ruby {
+ -webkit-text-emphasis: none;
text-emphasis: none;
}
-
+```
-編集者によっては、圏点と競合する場合にルビを隠すことを好みます。 HTML では、これは次のパターンで実現できます。
+### 圏点よりルビを優先させる場合 -em {
- text-emphasis: dot; /* <em> 要素に text-emphasis を設定 */
+編集者によっては、圏点と競合する場合にルビを隠すことを好みます。 HTML では、これは次のパターンで実現できます。
+
+```css
+em {
+ -webkit-text-emphasis: dot;
+ text-emphasis: dot; /* text-emphasis を 要素に設定 */
}
em rt {
- display: none; /* <em> 要素内のルビを隠す */
-}
-
-| 仕様書 | -状態 | -備考 | -
|---|---|---|
| {{SpecName('CSS3 Text Decoration', '#text-emphasis-position-property', 'text-emphasis')}} | -{{Spec2('CSS3 Text Decoration')}} | -初回定義 | -
{{Compat("css.properties.text-emphasis-position")}}
+{{Compat}} -CSS の text-emphasis-style プロパティは、圏点の表示を設定します。設定や解除に一括指定の {{cssxref("text-emphasis")}} を使用することもできます。
/* 初期値 */ +```css +/* 初期値 */ text-emphasis-style: none; /* 圏点なし */ -/* <string> 値 */ +/*- -値 */ text-emphasis-style: 'x'; text-emphasis-style: '点'; text-emphasis-style: '\25B2'; @@ -36,72 +38,61 @@ text-emphasis-style: open sesame; /* グローバル値 */ text-emphasis-style: inherit; text-emphasis-style: initial; +text-emphasis-style: revert; text-emphasis-style: unset; -
{{cssinfo}}
- -nonefilledfilled も open も指定されない場合は、これが既定値です。opendot'•' (U+2022)、 open dot は '◦' (U+25E6) です。circle'●' (U+25CF)、 open circle は '○' (U+25CB) です。double-circle'◉' (U+25C9)、 open double-circle は '◎' (U+25CE) です。triangle'▲' (U+25B2)、 open triangle は '△' (U+25B3) です。sesame'﹅' (U+FE45)、 open sesame は '﹆' (U+FE46) です。<string><string> には1文字を超える文字列を指定しないでください。ユーザーエージェントは、1つより多い書記素クラスターから構成される文字列を短縮したり無視したりする可能性があります。h2 {
+### 基本的な例
+
+```css
+h2 {
+ -webkit-text-emphasis-style: sesame;
text-emphasis-style: sesame;
-}
-
-| 仕様書 | -状態 | -備考 | -
|---|---|---|
| {{SpecName('CSS3 Text Decoration', '#text-emphasis-style-property', 'text-emphasis')}} | -{{Spec2('CSS3 Text Decoration')}} | -初回定義 | -
{{Compat("css.properties.text-emphasis-color")}}
- -text-emphasis は CSS のプロパティで、 (空白や制御文字を除く) テキストに圏点を適用します。これは {{cssxref("text-emphasis-style")}} と {{cssxref("text-emphasis-color")}} の一括指定です。
text-emphasis プロパティは、 {{cssxref("text-decoration")}} とは大きく異なります。 text-decoration プロパティは継承されず、指定される装飾は要素全体にわたって適用されます。しかし、 text-emphasis は継承されます。これは、子孫に対して圏点を変更できることを意味します。
圏点の大きさは、ルビと同様にフォントの大きさの約 50% であり、 text-emphasis は現在の行間隔が圏点を表示するのに十分でない場合、行の高さに影響を与えることがあります。
text-emphasis は、 {{cssxref("text-emphasis-position")}} の値をリセットしません。これは、圏点のスタイルと色がテキストで異なる場合に、圏点の位置を要求することがほとんど見込まれないためです。これを必要とするような珍しい場合は、プロパティ {{cssxref("text-emphasis-position")}} を使用してください。
このプロパティは以下のプロパティの一括指定です。
+このプロパティは以下の CSS プロパティの一括指定です。 - +- [`text-emphasis-color`](/ja/docs/Web/CSS/text-emphasis-color) +- [`text-emphasis-style`](/ja/docs/Web/CSS/text-emphasis-style) -/* 初期値 */ +```css +/* 初期値 */ text-emphasis: none; /* 圏点なし */ -/* <string> 値 */ +/*- -値 */ text-emphasis: 'x'; text-emphasis: '点'; text-emphasis: '\25B2'; @@ -61,72 +56,73 @@ text-emphasis: inherit; text-emphasis: initial; text-emphasis: revert; text-emphasis: unset; -
nonefilledfilled も open も指定されない場合は、これが既定値です。opendot'•' (U+2022)、 open dot は '◦' (U+25E6) です。circle'●' (U+25CF)、 open circle は '○' (U+25CB) です。これは、他の図形が与えられていない場合、横書きモードで既定の形状です。double-circle'◉' (U+25C9)、 open double-circle は '◎' (U+25CE) です。triangle'▲' (U+25B2)、 open triangle は '△' (U+25B3) です。sesame'﹅' (U+FE45)、 open sesame は'﹆' (U+FE46) です。これは、他の図形が与えられていない場合、縦書きモードで既定の形状です。<string><string> には 1 文字を超える文字列を指定しないでください。ユーザーエージェントは、 1 つより多い書記素クラスターから構成される文字列を短縮したり無視したりする可能性があります。<color>currentcolor です。{{CSSInfo}}
- -この例は、見出しの各文字に三角形の圏点を付けて描画します。
+この例は、見出しの各文字に三角形の圏点を付けて描画します。 -h2 {
+```css
+h2 {
+ -webkit-text-emphasis: triangle #D55;
text-emphasis: triangle #D55;
-}
+}
+```
-<h2>これは重要です!</h2>+```html +
{{EmbedLiveSample("A_heading_with_emphasis_shape_and_color", 500, 70)}}
+{{EmbedLiveSample("A_heading_with_emphasis_shape_and_color", 500, 90)}} -{{Compat}}
+{{Compat}} -text-shadow は CSS のプロパティで、テキストに影を追加します。文字列及びその装飾に適用される影のカンマで区切られたリストを受け付けます。それぞれの影は、要素からの X および Y オフセット、影の明るさ、影の色のうちいくつかの組み合わせで記述します。
/* offset-x | offset-y | blur-radius | color */ +```css +/* offset-x | offset-y | blur-radius | color */ text-shadow: 1px 1px 2px black; /* color | offset-x | offset-y | blur-radius */ @@ -50,101 +44,85 @@ text-shadow: 5px 10px; /* グローバル値 */ text-shadow: inherit; text-shadow: initial; +text-shadow: revert; text-shadow: unset; -+``` -
このプロパティは、影のカンマで区切られたリストとして指定します。
+このプロパティは、影のカンマで区切られたリストとして指定します。 -それぞれの影は2つ又は3つの <length> 値と、任意でその後に <color> 値を続けることで指定します。最初の2つの <length> 値は、 <offset-x> 及び <offset-y> の値です。3番目の <length> 値は、任意で、 <blur-radius> です。 <color> 値は影の色です。
複数の影が与えられた場合は、影は手前から奥に向けて適用され、最初に指定された影が一番上になります。
+複数の影が与えられた場合は、影は手前から奥に向けて適用され、最初に指定された影が一番上になります。 -このプロパティは {{cssxref("::first-line")}} 及び {{cssxref("::first-letter")}} の両方の擬似要素に適用されます。
+このプロパティは {{cssxref("::first-line")}} および {{cssxref("::first-letter")}} の両方の[擬似要素](/ja/docs/Web/CSS/Pseudo-elements)に適用されます。 -<offset-x> <offset-y><length> 値はテキストに対する影のオフセットを指定します。 <offset-x> は水平方向の距離を指定します。負の値であればテキストの左に影を配置します。 <offset-y> は垂直方向の距離を指定します。負の値であればテキストの上に影を配置します。両方の値が 0 ならば、影はテキストの真後ろに配置されますが、 <blur-radius> の効果により一部だけが見えるかもしれません。<blur-radius>0 になります。この値が大きいほど、ぼかしは大きくなり、影は広く薄くなります。{{CSSInfo}}
+{{CSSInfo}} -.red-text-shadow {
+```css
+.red-text-shadow {
text-shadow: red 0 -2px;
-}
+}
+```
-<p class="red-text-shadow">Sed ut perspiciatis unde omnis iste +```html +-Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, - totam rem aperiam, eaque ipsa quae ab illo inventore.</p>
{{EmbedLiveSample('Simple_shadow', '660px', '90px')}}
+{{EmbedLiveSample('Simple_shadow', '660px', '90px')}} -.white-text-with-blue-shadow {
+```css
+.white-text-with-blue-shadow {
text-shadow: 1px 1px 2px black, 0 0 1em blue, 0 0 0.2em blue;
color: white;
font: 1.5em Georgia, serif;
-}
+}
+```
-<p class="white-text-with-blue-shadow">Sed ut perspiciatis unde omnis iste +```html +-Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, - totam rem aperiam, eaque ipsa quae ab illo inventore.</p>
{{EmbedLiveSample('Multiple_shadows', '660px', '170px')}}
- -| 仕様書 | -状態 | -備考 | -
|---|---|---|
| {{SpecName('CSS3 Text Decoration', '#text-shadow-property', 'text-shadow')}} | -{{Spec2('CSS3 Text Decoration')}} | -CSS プロパティ text-shadow は CSS2 で不適切に定義され、 CSS2 (Level 1) で削除されました。 CSS Text Module Level 3 仕様で構文を改善しました。その後、 CSS Text Decoration Module Level 3 に移動しました。 |
-
{{Compat("css.properties.text-shadow")}}
- -text-shadow から色が指定されていない text-shadow への移行が動作しません ({{bug(726550)}})。これは Firefox の新しいパラレル CSS エンジン (Quantum CSS 又は Stylo とも呼ばれ、 Firefox 57 でリリースされる予定です) で修正されています。Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Nullam consectetur ac turpis vel laoreet. Nullam volutpat pharetra lorem, sit +amet feugiat tortor volutpat quis. Nam eget sodales quam. Aliquam accumsan +tellus ac erat posuere.
+ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Nullam consectetur ac turpis vel laoreet. Nullam volutpat pharetra lorem, sit +amet feugiat tortor volutpat quis. Nam eget sodales quam. Aliquam accumsan +tellus ac erat posuere.
+``` + +CSS はこのようになります。 + +```css +p { + font-size: 1.5rem; + text-transform: capitalize; + text-decoration: underline; + text-decoration-thickness: 2px; +} + +.horizontal { + text-underline-position: under; +} + +.vertical { + writing-mode: vertical-rl; + text-underline-position: left; +} +``` + +この例では、どちらの段落にも太い下線を引いています。横書きのテキストでは `text-underline-position: under;` を使用して、下線をすべてのディセンダーの下に引いています。 + +[`writing-mode`](/ja/docs/Web/CSS/writing-mode) を縦書きに設定した場合、必要に応じて `left` または `right` を使用して、傍線をテキストの左と右のどちらに引くか決めることができます。 + +ライブサンプルはこのようになります。 + +{{EmbedLiveSample('A_simple_example', '100%', 600)}} + +### グローバルに text-underline-position を設定する + +`text-underline-position` プロパティは継承され、{{cssxref("text-decoration")}} 一括指定プロパティでリセットされないため、グローバルレベルでこの値を設定する方が適切かもしれません。例えば、数多くの化学式や数式があり、下付き文字をたくさん使用している文書では、 `under` の値が適切かもしれません。 + +```css +:root { + text-underline-position: under; +} +``` + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- {{cssxref("text-decoration")}} プロパティは、{{cssxref("text-decoration-line")}}、{{cssxref("text-decoration-color")}}、{{cssxref("text-decoration-style")}} など、ほとんどのテキスト装飾プロパティを設定します。しかし、 `text-underline-position` は設定しません。 +- Microsoft [non-standard values documentation](https://msdn.microsoft.com/en-us/library/ie/ms531176%28v=vs.85%29.aspx) -- cgit v1.2.3-54-g00ecf