ナビゲーション

v2.1.0
タイポグラフィ

引用

他者の言葉を本文と区別して表示します。

このページの内容

引用は、他者の言葉を本文と区別して表示します。本文中では、引用の開始側に淡い縦線を添え、テキストには見出しと同じ色を使います。縦線はボーダーを使わずに描画し、両端を丸く仕上げています。

引用

<figure class="quote max-w(420) mx-auto">  <blockquote class="quote-body">    <p class="quote-text">Good tools make the next step clear and leave room for the work.</p>  </blockquote>  <figcaption class="quote-source">    <span class="avatar avatar-sm"><img class="avatar-image" src="/demo/portrait-1.svg" alt></span>    <span><span class="quote-name">Alex Morgan</span>Design lead, Atlas</span>  </figcaption></figure>
<figure className="quote max-w(420) mx-auto">  <blockquote className="quote-body">    <p className="quote-text">Good tools make the next step clear and leave room for the work.</p>  </blockquote>  <figcaption className="quote-source">    <span className="avatar avatar-sm">      <img className="avatar-image" src="/demo/portrait-1.svg" alt="" />    </span>    <span><span className="quote-name">Alex Morgan</span>Design lead, Atlas</span>  </figcaption></figure>
<figure class="quote max-w(420) mx-auto">  <blockquote class="quote-body">    <p class="quote-text">Good tools make the next step clear and leave room for the work.</p>  </blockquote>  <figcaption class="quote-source">    <span class="avatar avatar-sm"><img class="avatar-image" src="/demo/portrait-1.svg" alt></span>    <span><span class="quote-name">Alex Morgan</span>Design lead, Atlas</span>  </figcaption></figure>
<template>  <figure class="quote max-w(420) mx-auto">    <blockquote class="quote-body">      <p class="quote-text">Good tools make the next step clear and leave room for the work.</p>    </blockquote>    <figcaption class="quote-source">      <span class="avatar avatar-sm">        <img class="avatar-image" src="/demo/portrait-1.svg" alt>      </span>      <span><span class="quote-name">Alex Morgan</span>Design lead, Atlas</span>    </figcaption>  </figure></template>

引用文の各段落はquote-textに入れます。出典は引用文の一部ではないため、出典のある引用は<figure>にします。引用文はquote-bodyを指定した<blockquote>に入れ、出典はその後ろの、quote-sourceを指定した<figcaption>にまとめます。アバターがあれば添え、quote-nameは通常の文字色で、肩書きや場所は別の行に控えめな色で表示します。作品名は<cite>に入れます。出典のない引用は<blockquote>そのものに指定します。

#抜き出し引用

quote-lgは、引用文そのものを際立たせる抜き出し引用です。縦線に代えて開き引用符を表示し、各行の長さが釣り合うように折り返します。1ページに1か所、1〜2文にとどめてください。

抜き出し引用

<figure class="quote quote-lg max-w(480) mx-auto">  <blockquote class="quote-body">    <p class="quote-text">      We replaced four libraries with a stylesheet, and the interface got quieter.    </p>  </blockquote>  <figcaption class="quote-source">    <span class="avatar"><img class="avatar-image" src="/demo/portrait-3.svg" alt></span>    <span><span class="quote-name">Sam Lee</span>Engineering, <cite>Orbit Review</cite></span>  </figcaption></figure>
<figure className="quote quote-lg max-w(480) mx-auto">  <blockquote className="quote-body">    <p className="quote-text">      We replaced four libraries with a stylesheet, and the interface got quieter.    </p>  </blockquote>  <figcaption className="quote-source">    <span className="avatar">      <img className="avatar-image" src="/demo/portrait-3.svg" alt="" />    </span>    <span><span className="quote-name">Sam Lee</span>Engineering, <cite>Orbit Review</cite></span>  </figcaption></figure>
<figure class="quote quote-lg max-w(480) mx-auto">  <blockquote class="quote-body">    <p class="quote-text">      We replaced four libraries with a stylesheet, and the interface got quieter.    </p>  </blockquote>  <figcaption class="quote-source">    <span class="avatar"><img class="avatar-image" src="/demo/portrait-3.svg" alt></span>    <span><span class="quote-name">Sam Lee</span>Engineering, <cite>Orbit Review</cite></span>  </figcaption></figure>
<template>  <figure class="quote quote-lg max-w(480) mx-auto">    <blockquote class="quote-body">      <p class="quote-text">        We replaced four libraries with a stylesheet, and the interface got quieter.      </p>    </blockquote>    <figcaption class="quote-source">      <span class="avatar"><img class="avatar-image" src="/demo/portrait-3.svg" alt></span>      <span><span class="quote-name">Sam Lee</span>Engineering, <cite>Orbit Review</cite></span>    </figcaption>  </figure></template>

#複数段落

複数段落

<blockquote class="quote max-w(420) mx-auto">  <p class="quote-text">    The first version shipped with eleven components. We thought that was a start.  </p>  <p class="quote-text">It turned out to be most of what an interface needs, most of the time.</p></blockquote>
<blockquote className="quote max-w(420) mx-auto">  <p className="quote-text">    The first version shipped with eleven components. We thought that was a start.  </p>  <p className="quote-text">    It turned out to be most of what an interface needs, most of the time.  </p></blockquote>
<blockquote class="quote max-w(420) mx-auto">  <p class="quote-text">    The first version shipped with eleven components. We thought that was a start.  </p>  <p class="quote-text">It turned out to be most of what an interface needs, most of the time.</p></blockquote>
<template>  <blockquote class="quote max-w(420) mx-auto">    <p class="quote-text">      The first version shipped with eleven components. We thought that was a start.    </p>    <p class="quote-text">It turned out to be most of what an interface needs, most of the time.</p>  </blockquote></template>

#アクセシビリティ

  • 独立したブロックとして表示する引用には<blockquote>、文中の引用には<q>を使います。出典のURLはcite属性で指定できます。
  • 抜き出し引用の開き引用符は、スタイルシートで表示する装飾で、読み上げられません。抜き出し引用のテキスト自体には引用符を入力しないでください。
  • 出典のアバターの横には同じ名前が表示されるため、アバターのaltは空にします。

#クラス

クラス説明
quote先頭側に2pxの罫線を添えた引用文。
quote-lg抜き出し引用。縦線に代えて開始引用符を上に置き、大きな文字をバランスよく改行quote と併用します
quote-body出典のある引用の blockquote です。このとき引用全体は figure になり、出典はこのパーツの後ろの figcaption に、引用文の外側に置きます。
quote-text引用文の 1 段落
quote-source発言者と発言の出所。名前と控えめな補足行の横に、任意でアバターを表示
quote-name名前を強調色で独立した行に表示します。

#ソース

@master/ui/components/quote.css
/* * Quote: someone else's words, set apart from yours. * A quotation in running text hangs from a soft rail at its start. A large one is a pull quote: the words * carry it, balanced over their lines, under an opening mark. The source follows, quiet, with a name in ink. * A source is not part of the quotation, so a quote with one is a <figure>: the words in a <blockquote> with * quote-body, the source after it in a <figcaption>. A quote with no source is the <blockquote> itself. */@layer components.ui {  .quote {    position: relative;    display: grid;    gap: .75rem;    min-width: 0;    margin: 0;    padding-block: .125rem;    padding-inline: 1.125rem 0;    color: var(--color-text-strong);    font-size: .9375rem;    line-height: 1.6;    /* The rail: two pixels of line with round ends. It is drawn, not a border, so it never ends in a corner. */    &::before {      content: '';      position: absolute;      inset-block: 0;      inset-inline-start: 0;      width: 2px;      border-radius: 999px;      background: var(--color-line-strong);    }    /* Large: a pull quote. The rail gives way to an opening mark, and the words are balanced. */    &.quote-lg {      gap: 1.25rem;      padding: 0;      font-size: 1.375rem;      line-height: 1.4;      letter-spacing: -.015em;      &::before {        position: static;        width: 1.75rem;        height: 1.25rem;        border-radius: 0;        background: var(--color-line-mark);        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Cpath d='M0 20v-7.2C0 5.9 3.5 1.4 10.4 0l1.3 2.8C8.2 4 6.4 6.3 6.2 9.6H12V20zm16 0v-7.2C16 5.9 19.5 1.4 26.4 0l1.3 2.8C24.2 4 22.4 6.3 22.2 9.6H28V20z'/%3E%3C/svg%3E") center / contain no-repeat;      }      &:dir(rtl)::before {        scale: -1 1;      }      /* Han, kana and Hangul are not drawn tighter: tracking set for Latin capitals would crowd them. */      &:is(:lang(zh), :lang(ja), :lang(ko)) {        letter-spacing: 0;      }      .quote-text {        text-wrap: balance;      }    }    @media (forced-colors: active) {      &::before {        background: CanvasText;      }    }  }  /* The <blockquote> inside a quote that is a <figure>: it holds the paragraphs, spaced as the quote spaces them. */  .quote-body {    display: grid;    gap: inherit;    min-width: 0;    margin: 0;  }  /* A paragraph of the quotation. */  .quote-text {    margin: 0;    text-wrap: pretty;    overflow-wrap: anywhere;    hanging-punctuation: first;  }  /* Who said it, and where: an avatar, a name in ink and a quiet line, in the <figcaption>. Put the title of a work in <cite>. */  .quote-source {    display: flex;    align-items: center;    gap: .625rem;    min-width: 0;    color: var(--color-text-muted);    font-size: .8125rem;    font-style: normal;    line-height: 1.4;    letter-spacing: 0;    /* A source may be a long address: it breaks inside the row rather than pushing out of the quote. */    overflow-wrap: anywhere;  }  .quote-name {    display: block;    color: var(--color-text-strong);    font-weight: var(--font-weight-control);  }}