탐색

v2.1.0
타이포그래피

글머리 목록

글머리 기호를 별도의 열에 배치하는 본문용 목록입니다.

이 페이지의 내용

글머리 목록은 글의 요점, 계획에 포함된 항목, 문장으로 풀어 쓴 절차처럼 본문에 들어가는 목록입니다. 글머리 기호는 별도의 열에서 각 항목의 첫 줄에 맞춰 표시합니다. 텍스트가 여러 줄로 넘어가도 모든 항목은 같은 위치에서 시작합니다. HTML 기본 요소인 <ul> 또는 <ol>을 사용합니다.

글머리 목록

<ul class="bullets max-w(420) mx-auto">  <li class="bullets-item">Every overlay is a native element, opened without script.</li>  <li class="bullets-item">    Tokens retune every component, and a theme is a file of them that selects no component.  </li>  <li class="bullets-item">Each stylesheet has a contract beside it that says what it promises.</li></ul>
<ul className="bullets max-w(420) mx-auto">  <li className="bullets-item">Every overlay is a native element, opened without script.</li>  <li className="bullets-item">    Tokens retune every component, and a theme is a file of them that selects no component.  </li>  <li className="bullets-item">    Each stylesheet has a contract beside it that says what it promises.  </li></ul>
<ul class="bullets max-w(420) mx-auto">  <li class="bullets-item">Every overlay is a native element, opened without script.</li>  <li class="bullets-item">    Tokens retune every component, and a theme is a file of them that selects no component.  </li>  <li class="bullets-item">Each stylesheet has a contract beside it that says what it promises.</li></ul>
<template>  <ul class="bullets max-w(420) mx-auto">    <li class="bullets-item">Every overlay is a native element, opened without script.</li>    <li class="bullets-item">      Tokens retune every component, and a theme is a file of them that selects no component.    </li>    <li class="bullets-item">      Each stylesheet has a contract beside it that says what it promises.    </li>  </ul></template>

#글머리 기호

기본 글머리 기호는 작은 점입니다. 목록에 다음 두 클래스 중 하나를 적용하면 기호가 바뀝니다.

  • bullets-check는 요금제의 기능이나 릴리스의 변경 사항처럼 포함된 항목을 텍스트와 같은 색의 체크 표시로 나타냅니다.
  • bullets-numbered는 각 항목의 번호를 너비가 일정한 숫자로 표시하고 기호 열의 끝에 맞춰, 9에서 10으로 넘어가도 번호가 정렬되도록 합니다. 순서에 의미가 있는 <ol>에 사용하세요.

체크 표시와 번호

<ul class="bullets bullets-check w(220)">  <li class="bullets-item">Unlimited projects</li>  <li class="bullets-item">Custom domains, with certificates issued and renewed for you</li>  <li class="bullets-item">Preview for every branch</li></ul><ol class="bullets bullets-numbered w(220)">  <li class="bullets-item">Install the package.</li>  <li class="bullets-item">Import the stylesheet after the preset.</li>  <li class="bullets-item">Write the markup.</li></ol>
<>  <ul className="bullets bullets-check w(220)">    <li className="bullets-item">Unlimited projects</li>    <li className="bullets-item">Custom domains, with certificates issued and renewed for you</li>    <li className="bullets-item">Preview for every branch</li>  </ul>  <ol className="bullets bullets-numbered w(220)">    <li className="bullets-item">Install the package.</li>    <li className="bullets-item">Import the stylesheet after the preset.</li>    <li className="bullets-item">Write the markup.</li>  </ol></>
<ul class="bullets bullets-check w(220)">  <li class="bullets-item">Unlimited projects</li>  <li class="bullets-item">Custom domains, with certificates issued and renewed for you</li>  <li class="bullets-item">Preview for every branch</li></ul><ol class="bullets bullets-numbered w(220)">  <li class="bullets-item">Install the package.</li>  <li class="bullets-item">Import the stylesheet after the preset.</li>  <li class="bullets-item">Write the markup.</li></ol>
<template>  <ul class="bullets bullets-check w(220)">    <li class="bullets-item">Unlimited projects</li>    <li class="bullets-item">Custom domains, with certificates issued and renewed for you</li>    <li class="bullets-item">Preview for every branch</li>  </ul>  <ol class="bullets bullets-numbered w(220)">    <li class="bullets-item">Install the package.</li>    <li class="bullets-item">Import the stylesheet after the preset.</li>    <li class="bullets-item">Write the markup.</li>  </ol></template>

#미포함 항목

요금제의 구성 내용을 안내할 때는 포함되지 않는 항목도 함께 알려야 합니다. 항목에 bullets-off를 적용하면 글머리 기호 대신 짧은 대시가 표시되고 텍스트 색의 강조가 한 단계 낮아집니다. 대시와 색은 시각적 단서입니다. 두 단서를 볼 수 없는 사용자에게도 같은 의미를 전달하려면 예제처럼 sr-only 유틸리티로 시각적으로 숨긴 span에 ‘미포함:’과 같은 문구를 넣어 항목의 첫머리에 배치하세요.

미포함 항목

<div class="card w-full max-w(300)">  <div class="card-header">    <h3 class="card-title">Starter</h3>    <p class="card-description">For one person and a few projects.</p>  </div>  <ul class="bullets bullets-check">    <li class="bullets-item">Three projects</li>    <li class="bullets-item">Custom domains</li>    <li class="bullets-item bullets-off">      <span class="sr-only">Not included:</span>Single sign-on    </li>    <li class="bullets-item bullets-off"><span class="sr-only">Not included:</span>Audit log</li>  </ul></div>
<div className="card w-full max-w(300)">  <div className="card-header">    <h3 className="card-title">Starter</h3>    <p className="card-description">For one person and a few projects.</p>  </div>  <ul className="bullets bullets-check">    <li className="bullets-item">Three projects</li>    <li className="bullets-item">Custom domains</li>    <li className="bullets-item bullets-off">      <span className="sr-only">Not included:</span>Single sign-on    </li>    <li className="bullets-item bullets-off">      <span className="sr-only">Not included:</span>Audit log    </li>  </ul></div>
<div class="card w-full max-w(300)">  <div class="card-header">    <h3 class="card-title">Starter</h3>    <p class="card-description">For one person and a few projects.</p>  </div>  <ul class="bullets bullets-check">    <li class="bullets-item">Three projects</li>    <li class="bullets-item">Custom domains</li>    <li class="bullets-item bullets-off">      <span class="sr-only">Not included:</span>Single sign-on    </li>    <li class="bullets-item bullets-off"><span class="sr-only">Not included:</span>Audit log</li>  </ul></div>
<template>  <div class="card w-full max-w(300)">    <div class="card-header">      <h3 class="card-title">Starter</h3>      <p class="card-description">For one person and a few projects.</p>    </div>    <ul class="bullets bullets-check">      <li class="bullets-item">Three projects</li>      <li class="bullets-item">Custom domains</li>      <li class="bullets-item bullets-off">        <span class="sr-only">Not included:</span>Single sign-on      </li>      <li class="bullets-item bullets-off"><span class="sr-only">Not included:</span>Audit log</li>    </ul>  </div></template>

#중첩 목록과 간격

항목 안의 bullets 목록은 상위 항목의 텍스트 시작 위치까지 들여쓰고, 텍스트 아래 8px 간격을 두고 배치합니다. 항목 사이 간격은 8px이며 --bullets-gap으로 설정합니다. --bullets-marker는 글머리 기호 열의 너비입니다. 목록은 주변 텍스트의 글자 크기, 줄 높이, 색을 따르며 글머리 기호는 첫 줄에 맞춰 표시됩니다. 따라서 같은 목록을 글자 크기가 14px인 카드와 17px인 글에 모두 사용할 수 있습니다. 잉크 표면에서는 글머리 기호의 색도 텍스트와 함께 바뀝니다.

#글머리 목록, 목록, 체크리스트

글머리 목록은 문장으로 구성합니다. 각 행에 미디어, 제목, 끝에 배치할 요소가 있다면 목록을 사용하세요. 사용자가 완료 여부를 직접 표시하는 할 일에는 체크리스트를 사용하세요. 용어와 그에 해당하는 값에는 데이터 목록을 사용하세요.

#접근성

  • <ul>을 사용하고, 순서가 중요하면 <ol>을 사용하세요. 각 항목에는 <li>를 사용하세요. 스타일시트로 표시하는 글머리 기호는 스크린 리더가 읽지 않지만 목록과 항목 수는 안내합니다.
  • Safari에서 VoiceOver를 사용하면 글머리 기호를 제거한 목록에 role="list"이 없는 경우 목록으로 안내되지 않습니다. 항목 수를 알아야 내용을 이해할 수 있다면 이 속성을 추가하세요.
  • 체크 표시와 대시는 각각 ‘포함’과 ‘미포함’을 나타내는 시각적 단서입니다. 포함되지 않는 항목에는 그 사실을 텍스트로 명시하세요.

#클래스

클래스설명
bullets항목 간격은 8px입니다. 각 항목의 작은 점은 텍스트와 10px 떨어진 16px 너비의 열에 배치합니다. 주변 텍스트의 잉크 색을 따르므로 카드와 잉크 표면 모두에서 읽을 수 있습니다.
bullets-check포함된 항목에는 점 대신 텍스트와 같은 색상의 체크 표시를 사용합니다.적용할 클래스는 bullets입니다
bullets-numbered각 항목의 번호를 고정폭 숫자로 표시하고 표식 열의 끝에 정렬합니다. ol에 사용하세요.적용할 클래스는 bullets입니다
bullets-item항목 하나를 표시합니다. 표식은 첫 줄에 놓이며, 텍스트는 다른 항목과 같은 위치에서 시작합니다.
bullets-off포함되지 않은 항목은 표식 대신 짧은 대시를 표시하고 텍스트의 강조를 줄입니다.적용할 클래스는 bullets-item입니다

#사용자 지정 속성

속성기본값설명
--bullets-marker1rem표식 열의 너비입니다.
--bullets-gap.5rem항목 사이 간격

#소스 코드

@master/ui/components/bullets.css
/* * Bullets: a list in running text, with its markers hung in a column of their own. * The list and its markers take the ink of the text they stand in, so it reads on a page, a card and an ink * surface alike. A marker is a small dot; with bullets-check it is a check, for what is included; with * bullets-numbered each item counts itself in tabular figures. The marker stands on the first line of its * item, however the text wraps, and the text of every item starts on one edge. * An item that is bullets-off is what is not included: a short dash in place of its marker and quieter words. * Say so in words as well, for a reader who sees neither. * Geometry: a 16px marker column, 10px from the text, and 8px between items. */@layer components.ui {  .bullets {    --bullets-marker: 1rem;    --bullets-gap: .5rem;    display: grid;    gap: var(--bullets-gap);    min-width: 0;    margin: 0;    padding: 0;    list-style: none;    counter-reset: bullets;    /* A list inside an item stands a little apart from the words over it. */    & & {      margin-block-start: var(--bullets-gap);    }    /* Included: a check. */    &.bullets-check .bullets-item::before {      width: .875rem;      height: .875rem;      margin-block: calc((1lh - .875rem) / 2);      border-radius: 0;      background: currentColor;      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8L6.3532 11.3532A0.2 0.2 0 0 0 6.6412 11.3479L13 4.5'/%3E%3C/svg%3E") center / contain no-repeat;    }    /* Counted: the item's number, set to the end of the marker column so the figures line up on their points. */    &.bullets-numbered {      --bullets-marker: 1.25rem;      .bullets-item::before {        content: counter(bullets) '.';        width: var(--bullets-marker);        height: auto;        margin: 0;        border-radius: 0;        background: none;        /* Inside an item of a checked list the figures would be painted through the check's mask. */        mask: none;        /* Quieter than the words, and still 4.5:1 where the words are the body ink. */        color: color-mix(in oklab, currentColor 78%, transparent);        font-variant-numeric: tabular-nums;        text-align: end;      }    }    @media (forced-colors: active) {      &.bullets-check .bullets-item::before {        background: CanvasText;      }    }  }  /* One item: the marker in its column, the words beside it. */  .bullets-item {    position: relative;    min-width: 0;    margin: 0;    padding: 0;    padding-inline-start: calc(var(--bullets-marker) + .625rem);    text-wrap: pretty;    overflow-wrap: anywhere;    counter-increment: bullets;    /* The marker: a dot at the middle of the first line. */    &::before {      content: '';      position: absolute;      inset-block-start: 0;      inset-inline-start: calc((var(--bullets-marker) - .3125rem) / 2);      width: .3125rem;      height: .3125rem;      margin-block: calc((1lh - .3125rem) / 2);      border-radius: 999px;      background: color-mix(in oklab, currentColor 45%, transparent);    }    @media (forced-colors: active) {      &::before {        background: CanvasText;      }    }  }  .bullets-check .bullets-item::before, .bullets-numbered .bullets-item::before {    inset-inline-start: 0;  }  /*   * Not included: a dash where the marker was, and quieter words. They are still words to read: at 78% of the body   * ink they keep 4.5:1 on a raised face in both themes, where 62% fell to about 3.3:1.   */  .bullets .bullets-item.bullets-off {    color: color-mix(in oklab, currentColor 78%, transparent);    &::before {      content: '';      inset-inline-start: calc((var(--bullets-marker) - .5rem) / 2);      width: .5rem;      height: 1.5px;      margin-block: calc((1lh - 1.5px) / 2);      border-radius: 999px;      background: currentColor;      mask: none;    }    /* The dash's current color would be forced to the canvas and vanish: it takes the quiet system color. */    @media (forced-colors: active) {      &::before {        background: GrayText;      }    }  }}