タイポグラフィ
変更箇所の表示
修正対象の文の中に、追加した語句と、取り消し線を付けた削除語句を表示します。
このページの内容
変更箇所の表示は、修正案、変更の記録、訂正などで、修正対象の文の中に、追加された語句と削除された語句を示します。2 種類のネイティブ要素に、それぞれクラスを適用します。<ins>にinsを付けると、追加された語句に成功を示す色の淡い背景と細い下線が付きます。<del>にdelを付けると、削除された語句の文字色が少し淡くなり(文字に必要なコントラストは保たれます)、危険を示す色の淡い背景と取り消し線が付きます。
変更箇所の表示
<p class="m(0) max-w(480) mx-auto leading-md"> The release is planned for <del class="del">Thursday</del> <ins class="ins">Tuesday the 17th</ins>, and it <del class="del">will probably include</del> <ins class="ins">includes</ins> the new contracts. Every stylesheet has a contract beside it<ins class="ins">, and the two change together in the same commit</ins>.</p><p className="m(0) max-w(480) mx-auto leading-md"> The release is planned for <del className="del">Thursday</del> <ins className="ins">Tuesday the 17th</ins>, and it <del className="del">will probably include</del> <ins className="ins">includes</ins> the new contracts. Every stylesheet has a contract beside it<ins className="ins">, and the two change together in the same commit</ins>.</p><p class="m(0) max-w(480) mx-auto leading-md"> The release is planned for <del class="del">Thursday</del> <ins class="ins">Tuesday the 17th</ins>, and it <del class="del">will probably include</del> <ins class="ins">includes</ins> the new contracts. Every stylesheet has a contract beside it<ins class="ins">, and the two change together in the same commit</ins>.</p><template> <p class="m(0) max-w(480) mx-auto leading-md"> The release is planned for <del class="del">Thursday</del> <ins class="ins">Tuesday the 17th</ins>, and it <del class="del">will probably include</del> <ins class="ins">includes</ins> the new contracts. Every stylesheet has a contract beside it<ins class="ins">, and the two change together in the same commit</ins>. </p></template>#2 つの要素
変更の意味は要素自体が伝えます。<ins>と<del>は、語句がどう変更されたかをスクリーンリーダー、検索エンジン、スタイルシートのないブラウザーに伝えます。スタイルシートがなければ、既定でそれぞれ下線と取り消し線が付きます。どちらの要素にも、変更日時を示すdatetimeと、変更内容を説明する文書を参照するciteを指定できます。
クラスは淡い背景色を付けます。マークと同様、改行をまたいでも表示が続き、長い追加箇所では行ごとに背景の両端が丸くなります。
#色と線による区別
追加と削除は語句の状態を表すため、それぞれに対応するステータス色を使います。追加には下線、削除には取り消し線も付けるため、色を見分けられない読者にも区別できます。強制カラーモードでも、淡い背景色は省かれますが、線は残ります。
カード上とインク色の背景上
<div class="card w-full max-w(360)"> <p class="m(0)"> Ships on <del class="del">Thursday</del> <ins class="ins">Tuesday</ins>, with the contracts. </p></div><div class="sheet sheet-inverse p(20) w-full max-w(360)"> <p class="m(0)"> Ships on <del class="del">Thursday</del> <ins class="ins">Tuesday</ins>, with the contracts. </p></div><> <div className="card w-full max-w(360)"> <p className="m(0)"> Ships on <del className="del">Thursday</del> <ins className="ins">Tuesday</ins>, with the contracts. </p> </div> <div className="sheet sheet-inverse p(20) w-full max-w(360)"> <p className="m(0)"> Ships on <del className="del">Thursday</del> <ins className="ins">Tuesday</ins>, with the contracts. </p> </div></><div class="card w-full max-w(360)"> <p class="m(0)"> Ships on <del class="del">Thursday</del> <ins class="ins">Tuesday</ins>, with the contracts. </p></div><div class="sheet sheet-inverse p(20) w-full max-w(360)"> <p class="m(0)"> Ships on <del class="del">Thursday</del> <ins class="ins">Tuesday</ins>, with the contracts. </p></div><template> <div class="card w-full max-w(360)"> <p class="m(0)"> Ships on <del class="del">Thursday</del> <ins class="ins">Tuesday</ins>, with the contracts. </p> </div> <div class="sheet sheet-inverse p(20) w-full max-w(360)"> <p class="m(0)"> Ships on <del class="del">Thursday</del> <ins class="ins">Tuesday</ins>, with the contracts. </p> </div></template>#変更箇所の表示とコード差分
変更箇所の表示は文中の語句の変更に使います。コードが行単位で変わった場合は、code-line-addedとcode-line-removedで対象行とそのガターを示せるコードブロックを使います。変更を伴わない語句の強調にはマークを使います。
#アクセシビリティ
<ins>と<del>を使い、<span>にクラスを付けないでください。変更の意味を伝えるのは要素自体なので、それ以外の要素にクラスを付けるとチェッカーがエラーにします。- 追加や削除を既定で読み上げるかどうかは、スクリーンリーダーによって異なります。変更を知ることが理解に必要な場合は、文中でもそのことを伝えるか、本文の前に変更点をまとめます。
- 置き換えは、削除した語句、空白、追加した語句の順に並べると読みやすくなります。
#クラス
| クラス | 説明 |
|---|---|
ins | 挿入した語句を示す ins 要素に適用します。成功を示す色の淡い背景と細い下線を付けます。 |
del | 削除した語句を示す del 要素に適用します。前景色を控えめにしつつ文字のコントラスト 4.5:1 を保ち、危険を示す色の淡い背景と取り消し線を付けます。 |