Holo i ka ʻike nui Holo i ka hoʻokele docs
Check
in English

Lai palaoa

Hōʻike i kahi o ka ʻaoʻao o kēia manawa i loko o kahi hierarchy hoʻokele e hoʻohui ʻakomi i nā mea hoʻokaʻawale ma o CSS.

Laʻana

E hoʻohana i kahi papa inoa kauoha ʻole ʻia me nā mea papa inoa i hoʻopili ʻia e hana ai i kahi ʻāpana palaoa liʻiliʻi. E hoʻohana i kā mākou mea pono e hoʻohui i nā kaila hou e like me ka makemake.

html
<nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item active" aria-current="page">Home</li>
  </ol>
</nav>

<nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#">Home</a></li>
    <li class="breadcrumb-item active" aria-current="page">Library</li>
  </ol>
</nav>

<nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#">Home</a></li>
    <li class="breadcrumb-item"><a href="#">Library</a></li>
    <li class="breadcrumb-item active" aria-current="page">Data</li>
  </ol>
</nav>

Nā mea hoʻokaʻawale

Hoʻohui ʻia nā mea hoʻokaʻawale i CSS ma o ::beforea content. Hiki ke hoʻololi ʻia lākou ma ka hoʻololi ʻana i kahi waiwai maʻamau CSS kūloko --bs-breadcrumb-divider, a i ʻole ma o ke $breadcrumb-dividerʻano Sass - a $breadcrumb-divider-flippedno kāna hoa RTL, inā pono. Hoʻopaʻa mākou i kā mākou ʻano Sass, i hoʻonohonoho ʻia ma ke ʻano he hāʻule i ka waiwai maʻamau. Ma kēia ala, loaʻa iā ʻoe kahi mea hoʻokaʻawale honua hiki iā ʻoe ke hoʻopau me ka ʻole e hoʻopili hou i ka CSS i kēlā me kēia manawa.

html
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#">Home</a></li>
    <li class="breadcrumb-item active" aria-current="page">Library</li>
  </ol>
</nav>

Ke hoʻololi nei ma o Sass, pono ka hana ʻōlelo e hoʻopuka i nā ʻōlelo a puni kahi kaula. No ka laʻana, me ka hoʻohana >ʻana i ka mea hoʻokaʻawale, hiki iā ʻoe ke hoʻohana i kēia:

$breadcrumb-divider: quote(">");

Hiki nō ke hoʻohana i kahi kiʻiona SVG i hoʻokomo ʻia . E noi iā ia ma o kā mākou waiwai maʻamau CSS, a i ʻole e hoʻohana i ka hoʻololi Sass.

Ke hoʻohana nei i ka SVG i hoʻopili ʻia

ʻO ka hoʻokomo ʻana i ka SVG ma ke ʻano he URI ʻikepili e pono ai ka URL e pakele i kekahi mau huaʻōlelo, ʻoi aku ka nui <, >a me #. ʻO ia ke kumu i hoʻolilo ʻia ai ka $breadcrumb-dividerhoʻololi i kā mākou escape-svg()hana Sass . Ke hoʻohana nei i ka waiwai maʻamau CSS, pono ʻoe e pakele i kāu SVG iā ʻoe iho. E heluhelu i nā wehewehe a Kevin Weber ma CodePen no ka ʻike kikoʻī i ka mea e pakele ai.

html
<nav style="--bs-breadcrumb-divider: url(&#34;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='%236c757d'/%3E%3C/svg%3E&#34;);" aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#">Home</a></li>
    <li class="breadcrumb-item active" aria-current="page">Library</li>
  </ol>
</nav>
$breadcrumb-divider: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8'><path d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='#{$breadcrumb-divider-color}'/></svg>");

Hiki iā ʻoe ke hoʻoneʻe i ka hoʻonohonoho hoʻokaʻawale --bs-breadcrumb-divider: '';(ʻo nā kaula ʻole i nā waiwai maʻamau CSS i helu ʻia ma ke ʻano he waiwai), a i ʻole ka hoʻonohonoho ʻana i ka hoʻololi Sass i $breadcrumb-divider: none;.

html
<nav style="--bs-breadcrumb-divider: '';" aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#">Home</a></li>
    <li class="breadcrumb-item active" aria-current="page">Library</li>
  </ol>
</nav>
$breadcrumb-divider: none;

Hiki ke komo

Ma muli o ka hoʻokele ʻana i ka palaoa, he manaʻo maikaʻi e hoʻohui i kahi lepili koʻikoʻi e like me aria-label="breadcrumb"ka wehewehe ʻana i ke ʻano o ka hoʻokele i hāʻawi ʻia i ka <nav>mea, a me ka hoʻopili ʻana i kahi mea aria-current="page"hope o ka set e hōʻike ai i ka ʻaoʻao o kēia manawa.

No ka 'ike hou aku, e 'ike i ka ARIA Authoring Practices Guide pattern breadcrumb .

CSS

Nā mea hoʻololi

Hoʻohui ʻia ma v5.2.0

Ma ke ʻano o ka hoʻokokoke ʻana o nā ʻano hoʻololi CSS e ulu ana a Bootstrap, ke hoʻohana nei ka palaoa i nā ʻano CSS kūloko .breadcrumbno ka hoʻomaikaʻi ʻana i ka manawa maoli. Hoʻonohonoho ʻia nā waiwai no nā ʻano CSS ma o Sass, no laila ke kākoʻo mau ʻia nei ka hana maʻamau Sass.

  --#{$prefix}breadcrumb-padding-x: #{$breadcrumb-padding-x};
  --#{$prefix}breadcrumb-padding-y: #{$breadcrumb-padding-y};
  --#{$prefix}breadcrumb-margin-bottom: #{$breadcrumb-margin-bottom};
  @include rfs($breadcrumb-font-size, --#{$prefix}breadcrumb-font-size);
  --#{$prefix}breadcrumb-bg: #{$breadcrumb-bg};
  --#{$prefix}breadcrumb-border-radius: #{$breadcrumb-border-radius};
  --#{$prefix}breadcrumb-divider-color: #{$breadcrumb-divider-color};
  --#{$prefix}breadcrumb-item-padding-x: #{$breadcrumb-item-padding-x};
  --#{$prefix}breadcrumb-item-active-color: #{$breadcrumb-active-color};
  

Nā hoʻololi Sass

$breadcrumb-font-size:              null;
$breadcrumb-padding-y:              0;
$breadcrumb-padding-x:              0;
$breadcrumb-item-padding-x:         .5rem;
$breadcrumb-margin-bottom:          1rem;
$breadcrumb-bg:                     null;
$breadcrumb-divider-color:          $gray-600;
$breadcrumb-active-color:           $gray-600;
$breadcrumb-divider:                quote("/");
$breadcrumb-divider-flipped:        $breadcrumb-divider;
$breadcrumb-border-radius:          null;