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
|
@ -114,14 +114,35 @@
|
|||
</<b>nav</b>>
|
||||
</<b>aside</b>></code></pre>
|
||||
|
||||
</footer>
|
||||
</article>
|
||||
</section>
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
${require('./_footer.html')}
|
||||
|
||||
</div>
|
||||
</main>
|
||||
<script src="js/commons.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<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>
|
||||
|
||||
${require('./_footer.html')}
|
||||
|
||||
</div>
|
||||
</main>
|
||||
<script src="js/commons.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -51,6 +51,24 @@ nav {
|
|||
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
|
||||
|
|
|
@ -68,7 +68,7 @@ ul {
|
|||
|
||||
// Links
|
||||
// 1. Remove the gray background on active links in IE 10
|
||||
a {
|
||||
a:not(::after) {
|
||||
--color: var(--primary);
|
||||
--background-color: transparent;
|
||||
outline: none;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue