mirror of
https://github.com/picocss/pico.git
synced 2025-04-20 16:46:14 -04:00
feat: add a semantic way for creating a breadcrumb
This commit is contained in:
parent
a018211b14
commit
8049be9ffa
3 changed files with 50 additions and 11 deletions
|
@ -116,6 +116,26 @@
|
||||||
|
|
||||||
</footer>
|
</footer>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
<p>With <code><b>role="breadcrumb"</b></code>, you can turn a nav into a breadcrumb.</p>
|
||||||
|
|
||||||
|
<article aria-label="Breadcrumb nav example">
|
||||||
|
<nav role="breadcrumb">
|
||||||
|
<a href="#">First link</a>
|
||||||
|
<a href="#">Second link</a>
|
||||||
|
Last link
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<footer class="code">
|
||||||
|
|
||||||
|
<pre><code><<b>nav</b> <i>role</i>=<u>"breadcrumb"</u>>
|
||||||
|
<<b>a</b> <i>href</i>=<u>"#"</u>>First link<<b>/a</b>>
|
||||||
|
<<b>a</b> <i>href</i>=<u>"#"</u>>Second link<<b>/a</b>>
|
||||||
|
Last link
|
||||||
|
</<b>nav</b>></code></pre>
|
||||||
|
</footer>
|
||||||
|
</article>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
${require('./_footer.html')}
|
${require('./_footer.html')}
|
||||||
|
@ -123,5 +143,6 @@
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<script src="js/commons.min.js"></script>
|
<script src="js/commons.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -51,6 +51,24 @@ nav {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&[role="breadcrumb"] {
|
||||||
|
align-items: center;
|
||||||
|
justify-content: left;
|
||||||
|
|
||||||
|
font-size: 1.2rem;
|
||||||
|
|
||||||
|
& a {
|
||||||
|
padding-right: 1rem;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: " / ";
|
||||||
|
color: var(--color);
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vertical Nav
|
// Vertical Nav
|
||||||
|
|
|
@ -68,7 +68,7 @@ ul {
|
||||||
|
|
||||||
// Links
|
// Links
|
||||||
// 1. Remove the gray background on active links in IE 10
|
// 1. Remove the gray background on active links in IE 10
|
||||||
a {
|
a:not(::after) {
|
||||||
--color: var(--primary);
|
--color: var(--primary);
|
||||||
--background-color: transparent;
|
--background-color: transparent;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue