311 lines
5.7 KiB
CSS
311 lines
5.7 KiB
CSS
/* --- Shared Navbar Start --- */
|
|
|
|
.navbar {
|
|
position: sticky;
|
|
top: clamp(0.75rem, 2vw, 1.25rem);
|
|
z-index: var(--z-nav);
|
|
display: flex;
|
|
justify-content: center;
|
|
width: 100%;
|
|
padding-inline: var(--page-x);
|
|
}
|
|
|
|
.nav-pill {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: clamp(0.25rem, 0.8vw, 0.65rem);
|
|
width: fit-content;
|
|
max-width: 100%;
|
|
min-height: clamp(3rem, 5.4vw, 3.5rem);
|
|
padding: clamp(0.32rem, 0.8vw, 0.55rem);
|
|
border: 1px solid transparent;
|
|
border-radius: 999px;
|
|
backdrop-filter: blur(18px) saturate(1.2);
|
|
-webkit-backdrop-filter: blur(18px) saturate(1.2);
|
|
box-shadow: 0 16px 50px rgba(0, 0, 0, 0.16);
|
|
}
|
|
|
|
.nav-link {
|
|
position: relative;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-height: 42px;
|
|
min-width: 42px;
|
|
padding: 0 clamp(0.72rem, 1.5vw, 1rem);
|
|
border-radius: 999px;
|
|
color: inherit;
|
|
font-size: var(--text-xs);
|
|
line-height: 1;
|
|
text-decoration: none;
|
|
white-space: nowrap;
|
|
transition:
|
|
background-color var(--duration-med) var(--ease-out),
|
|
color var(--duration-med) var(--ease-out),
|
|
opacity var(--duration-med) var(--ease-out),
|
|
transform var(--duration-med) var(--ease-out);
|
|
}
|
|
|
|
.nav-link--brand {
|
|
padding-inline: clamp(0.75rem, 1.4vw, 1rem);
|
|
}
|
|
|
|
.nav-link--back {
|
|
gap: 0.5rem;
|
|
min-width: 0;
|
|
text-transform: none;
|
|
}
|
|
|
|
.nav-back-icon {
|
|
display: inline-block;
|
|
width: 0.95rem;
|
|
height: 0.95rem;
|
|
flex: 0 0 auto;
|
|
background: currentColor;
|
|
-webkit-mask: url("/icon-arrow-left.svg") center / contain no-repeat;
|
|
mask: url("/icon-arrow-left.svg") center / contain no-repeat;
|
|
}
|
|
|
|
.nav-brand-logo {
|
|
display: block;
|
|
width: clamp(58px, 5.2vw, 82px);
|
|
height: auto;
|
|
}
|
|
|
|
.nav-button {
|
|
border: none;
|
|
font-family: inherit;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.nav-theme-switch {
|
|
min-width: 46px;
|
|
padding-inline: 0.55rem;
|
|
}
|
|
|
|
.nav-theme-switch__track {
|
|
position: relative;
|
|
width: 40px;
|
|
height: 22px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 2px;
|
|
border: 1px solid;
|
|
border-radius: 999px;
|
|
transition:
|
|
background-color var(--duration-med) var(--ease-out),
|
|
border-color var(--duration-med) var(--ease-out);
|
|
}
|
|
|
|
.nav-theme-switch__thumb {
|
|
width: 16px;
|
|
height: 16px;
|
|
border-radius: 50%;
|
|
transform: translateX(0);
|
|
transition:
|
|
transform var(--duration-med) var(--ease-snap),
|
|
background-color var(--duration-med) var(--ease-out);
|
|
}
|
|
|
|
.nav-theme-switch.is-light .nav-theme-switch__thumb {
|
|
transform: translateX(18px);
|
|
}
|
|
|
|
.nav-label--compact {
|
|
display: none;
|
|
}
|
|
|
|
/* Hero variant */
|
|
.navbar--hero {
|
|
position: fixed;
|
|
top: clamp(0.75rem, 2.1vw, 1.4rem);
|
|
left: 0;
|
|
right: 0;
|
|
z-index: var(--z-nav);
|
|
padding-top: 0;
|
|
}
|
|
|
|
.navbar--hero .nav-pill {
|
|
background: rgba(10, 10, 10, 0.82);
|
|
border-color: rgba(255, 255, 255, 0.34);
|
|
}
|
|
|
|
.navbar--hero .nav-link {
|
|
color: #fff;
|
|
}
|
|
|
|
.navbar--hero .nav-button {
|
|
background: transparent;
|
|
}
|
|
|
|
.navbar--hero .nav-theme-switch__track {
|
|
border-color: rgba(255, 255, 255, 0.34);
|
|
background: rgba(255, 255, 255, 0.14);
|
|
}
|
|
|
|
.navbar--hero .nav-theme-switch__thumb {
|
|
background: #fff;
|
|
}
|
|
|
|
.navbar--hero .nav-link:hover,
|
|
.navbar--hero .nav-link.active {
|
|
background: rgba(255, 255, 255, 0.22);
|
|
}
|
|
|
|
/* Detail page variant */
|
|
.navbar--light {
|
|
margin-bottom: clamp(1rem, 2.5vw, 1.8rem);
|
|
padding-top: clamp(0.35rem, 1vw, 0.7rem);
|
|
}
|
|
|
|
.navbar--light .nav-pill {
|
|
background: color-mix(in srgb, var(--theme-paper) 86%, transparent);
|
|
border-color: var(--theme-border);
|
|
}
|
|
|
|
.navbar--light .nav-link {
|
|
color: var(--theme-text);
|
|
}
|
|
|
|
.navbar--light .nav-button {
|
|
background: transparent;
|
|
}
|
|
|
|
.navbar--light .nav-theme-switch__track {
|
|
border-color: var(--theme-border-strong);
|
|
background: rgba(38, 38, 38, 0.08);
|
|
}
|
|
|
|
.navbar--light .nav-theme-switch__thumb {
|
|
background: var(--theme-text);
|
|
}
|
|
|
|
.navbar--light .nav-link:hover,
|
|
.navbar--light .nav-link.active {
|
|
background: var(--theme-surface-soft);
|
|
}
|
|
|
|
/* --- Shared Navbar End --- */
|
|
|
|
@media (max-width: 700px) {
|
|
.navbar {
|
|
padding-inline: clamp(0.75rem, 4vw, 1rem);
|
|
}
|
|
|
|
.nav-pill {
|
|
width: fit-content;
|
|
max-width: calc(100vw - 1.5rem);
|
|
justify-content: center;
|
|
flex-wrap: nowrap;
|
|
gap: clamp(0.2rem, 1.2vw, 0.4rem);
|
|
padding: 0.35rem;
|
|
}
|
|
|
|
.nav-link {
|
|
min-height: 38px;
|
|
min-width: 38px;
|
|
flex: 0 0 auto;
|
|
padding-inline: 0.5rem;
|
|
font-size: 0.72rem;
|
|
}
|
|
|
|
.nav-link--brand {
|
|
padding-inline: 0.65rem;
|
|
}
|
|
|
|
.nav-brand-logo {
|
|
width: 50px;
|
|
}
|
|
|
|
.nav-theme-switch {
|
|
flex: 0 0 auto;
|
|
min-width: 42px;
|
|
padding-inline: 0.45rem;
|
|
}
|
|
|
|
.nav-theme-switch__track {
|
|
width: 36px;
|
|
height: 20px;
|
|
}
|
|
|
|
.nav-theme-switch__thumb {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
.nav-theme-switch.is-light .nav-theme-switch__thumb {
|
|
transform: translateX(16px);
|
|
}
|
|
|
|
.nav-link--cart .nav-label--full {
|
|
display: none;
|
|
}
|
|
|
|
.nav-link--cart .nav-label--compact {
|
|
display: inline;
|
|
}
|
|
|
|
.navbar--hero .nav-pill {
|
|
width: fit-content;
|
|
max-width: calc(100vw - 1.5rem);
|
|
}
|
|
}
|
|
|
|
@media (max-width: 390px) {
|
|
.nav-pill {
|
|
padding: 0.3rem;
|
|
}
|
|
|
|
.nav-link {
|
|
padding-inline: 0.3rem;
|
|
font-size: 0.68rem;
|
|
}
|
|
|
|
.nav-link--brand {
|
|
padding-inline: 0.45rem;
|
|
}
|
|
|
|
.nav-brand-logo {
|
|
width: 44px;
|
|
}
|
|
|
|
.nav-theme-switch {
|
|
min-width: 36px;
|
|
padding-inline: 0.3rem;
|
|
}
|
|
|
|
.nav-theme-switch__track {
|
|
width: 32px;
|
|
height: 18px;
|
|
}
|
|
|
|
.nav-theme-switch__thumb {
|
|
width: 12px;
|
|
height: 12px;
|
|
}
|
|
|
|
.nav-theme-switch.is-light .nav-theme-switch__thumb {
|
|
transform: translateX(14px);
|
|
}
|
|
}
|
|
|
|
@media (max-width: 430px) {
|
|
.nav-link--back {
|
|
gap: 0;
|
|
}
|
|
|
|
.nav-link--back span:not(.nav-back-icon) {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.nav-link,
|
|
.nav-theme-switch__thumb,
|
|
.nav-theme-switch__track,
|
|
.nav-pill {
|
|
transition: none;
|
|
}
|
|
}
|