2022-10-23 10:47:50 +07:00
|
|
|
|
@use "sass:map";
|
2022-10-22 13:11:51 +07:00
|
|
|
|
@use "../settings" as *;
|
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
@if map.get($modules, "components/nav") {
|
|
|
|
|
/**
|
|
|
|
|
* Nav
|
|
|
|
|
*/
|
2019-11-27 15:31:49 +07:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
// Reboot based on :
|
|
|
|
|
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
|
2022-03-06 10:53:20 +07:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
// Prevent VoiceOver from ignoring list semantics in Safari (opinionated)
|
|
|
|
|
:where(nav li)::before {
|
|
|
|
|
float: left;
|
|
|
|
|
content: "\200B";
|
|
|
|
|
}
|
2022-03-06 10:53:20 +07:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
// Pico
|
|
|
|
|
// ––––––––––––––––––––
|
2022-03-06 10:53:20 +07:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
nav,
|
|
|
|
|
nav ul {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
2019-11-27 15:31:49 +07:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
nav {
|
|
|
|
|
justify-content: space-between;
|
2019-11-27 15:31:49 +07:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
ol,
|
|
|
|
|
ul {
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
list-style: none;
|
2019-11-27 15:31:49 +07:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
&:first-of-type {
|
|
|
|
|
margin-left: calc(var(#{$✨}nav-element-spacing-horizontal) * -1);
|
|
|
|
|
}
|
|
|
|
|
&:last-of-type {
|
|
|
|
|
margin-right: calc(var(#{$✨}nav-element-spacing-horizontal) * -1);
|
|
|
|
|
}
|
2019-11-27 15:31:49 +07:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
li {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: var(#{$✨}nav-element-spacing-vertical) var(#{$✨}nav-element-spacing-horizontal);
|
2019-11-27 15:31:49 +07:00
|
|
|
|
|
2023-01-01 13:49:42 +07:00
|
|
|
|
:where(a, [role="link"]) {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
margin: calc(var(#{$✨}nav-link-spacing-vertical) * -1)
|
|
|
|
|
calc(var(#{$✨}nav-link-spacing-horizontal) * -1);
|
|
|
|
|
padding: var(#{$✨}nav-link-spacing-vertical) var(#{$✨}nav-link-spacing-horizontal);
|
|
|
|
|
border-radius: var(#{$✨}border-radius);
|
2019-11-27 15:31:49 +07:00
|
|
|
|
|
2023-01-01 13:49:42 +07:00
|
|
|
|
&:not(:hover) {
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-23 10:47:50 +07:00
|
|
|
|
|
2023-01-01 13:49:42 +07:00
|
|
|
|
// Minimal support for buttons and forms elements
|
|
|
|
|
button,
|
|
|
|
|
[role="button"],
|
|
|
|
|
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]),
|
|
|
|
|
select {
|
|
|
|
|
height: auto;
|
|
|
|
|
margin-right: inherit;
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
margin-left: inherit;
|
|
|
|
|
padding: calc(var(#{$✨}nav-link-spacing-vertical) - (var(#{$✨}border-width) * 2))
|
|
|
|
|
var(#{$✨}nav-link-spacing-horizontal);
|
2022-10-23 10:47:50 +07:00
|
|
|
|
}
|
2019-11-30 12:43:20 +07:00
|
|
|
|
}
|
2022-01-25 21:13:14 +01:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
// Breadcrumb
|
|
|
|
|
&[aria-label="breadcrumb"] {
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: start;
|
2022-06-12 12:32:25 +02:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
& ul li {
|
|
|
|
|
&:not(:first-child) {
|
|
|
|
|
margin-inline-start: var(#{$✨}nav-link-spacing-horizontal);
|
|
|
|
|
}
|
2022-06-12 12:32:25 +02:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
&:not(:last-child) {
|
|
|
|
|
::after {
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: calc(var(#{$✨}nav-link-spacing-horizontal) * 2);
|
|
|
|
|
margin-inline-start: calc(var(#{$✨}nav-link-spacing-horizontal) / 2);
|
|
|
|
|
content: "/";
|
|
|
|
|
color: var(#{$✨}muted-color);
|
|
|
|
|
text-align: center;
|
2023-01-01 13:49:42 +07:00
|
|
|
|
text-decoration: none;
|
2022-10-23 10:47:50 +07:00
|
|
|
|
}
|
2022-02-08 11:07:18 +01:00
|
|
|
|
}
|
2022-01-25 21:13:14 +01:00
|
|
|
|
}
|
2022-02-08 11:07:18 +01:00
|
|
|
|
|
2023-01-01 13:49:42 +07:00
|
|
|
|
// Minimal support for aria-current
|
2022-10-23 10:47:50 +07:00
|
|
|
|
& a[aria-current] {
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
color: inherit;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
}
|
2022-02-08 11:07:18 +01:00
|
|
|
|
}
|
2019-11-27 15:31:49 +07:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
// Vertical Nav
|
|
|
|
|
aside {
|
|
|
|
|
nav,
|
|
|
|
|
ol,
|
|
|
|
|
ul,
|
|
|
|
|
li {
|
2022-02-27 14:41:34 +07:00
|
|
|
|
display: block;
|
|
|
|
|
}
|
2022-03-06 09:37:03 +07:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
li {
|
|
|
|
|
padding: calc(var(#{$✨}nav-element-spacing-vertical) * 0.5)
|
|
|
|
|
var(#{$✨}nav-element-spacing-horizontal);
|
|
|
|
|
|
|
|
|
|
a {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Minimal support for links as buttons
|
|
|
|
|
[role="button"] {
|
|
|
|
|
margin: inherit;
|
|
|
|
|
}
|
2019-11-27 15:31:49 +07:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 02:16:29 +07:00
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
|
// Breadcrumb RTL
|
|
|
|
|
[dir="rtl"] {
|
|
|
|
|
nav {
|
|
|
|
|
&[aria-label="breadcrumb"] {
|
|
|
|
|
& ul li {
|
|
|
|
|
&:not(:last-child) {
|
|
|
|
|
::after {
|
|
|
|
|
content: "\\";
|
|
|
|
|
}
|
2022-09-13 02:16:29 +07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-15 23:22:12 +07:00
|
|
|
|
}
|