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.
<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 ::before
a 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-flipped
no 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.
<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.
<nav style="--bs-breadcrumb-divider: url("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='currentColor'/%3E%3C/svg%3E");" 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,%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='currentColor'/%3E%3C/svg%3E");
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;
.
<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 WAI-ARIA Authoring Practices no ke kumu palaoa .
Sass
Nā mea hoʻololi
$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;