Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add [type] support to <ol> breadcrumbs. #72

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,22 @@ details,
font-family: var(--secondary-font);

& ul, & ol {
list-style: none;
padding-inline-start: 0;
}
& :is(ul, ol):not([type]) {
list-style: none;
}

& li {
display: inline;
&+li::before {
display: inline list-item;
&:not(:last-child)::after {
content: ' / ' / '';
content: ' / ';
display: inline;
}
}

& [aria-current="page"] {
& [aria-current="page"], & [aria-current="step"] {
font-weight: bold;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ ul {
}

ol {
list-style: decimal;
}

dl {
Expand Down
50 changes: 48 additions & 2 deletions www/docs/30-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,23 @@ element will house the rest of the page. See this example:
Add <dfn>`.breadcrumbs`</dfn> to a `<nav>` element. Use an `<ul>` or `<ol>` of
links inside. Don't forget to add an `aria-label`.

Add the attribute `aria-current=page` to the link representing the current page
(if any).
Add the attribute `aria-current=page` (or `step`) to the link representing the current
page or step (if any).

<figure>

~~~ html
<nav class=breadcrumbs aria-label="Breadcrumbs">
<ol>
<li><a href="#">Home</a></li>
<li><a href="#">User</a></li>
<li><a href="#">Advanced</a></li>
<li><a href="#">New All</a></li>
<li><a href="#" aria-current=page>Quit Sibelius</a></li>
</ol>
</nav>
~~~

<nav class=breadcrumbs aria-label="Breadcrumbs">
<ol>
<li><a href="#">Home</a></li>
Expand All @@ -191,6 +204,39 @@ Add the attribute `aria-current=page` to the link representing the current page
</nav>
</figure>

If you want to preserve the `<ol>` numbering, use the `type` attribute.

<figure>

~~~ html
<header class="packed">
<strong class="<h1>">Checkout</strong>
<nav class=breadcrumbs aria-label="Breadcrumbs">
<ol type="i">
<li><a href="#">Cart</a></li>
<li><a href="#" aria-current=step>Account</a></li>
<li>Info</li>
<li>Payment</li>
<li>Review</li>
</ol>
</nav>
</header>
~~~

<header class="packed">
<strong class="<h1>">Checkout</strong>
<nav class=breadcrumbs aria-label="Breadcrumbs">
<ol type="i">
<li><a href="#">Cart</a></li>
<li><a href="#" aria-current=step>Account</a></li>
<li>Info</li>
<li>Payment</li>
<li>Review</li>
</ol>
</nav>
</header>
</figure>


## Chip

Expand Down