The theme switch was three labelled radios that wrapped the header onto a second line with long translations. It is three SVG buttons now, with search and menu sharing the same language: no resting outline, a filled chip for the active choice. Radios gave arrow-key roving for free, so the group reimplements it rather than losing it. The first chip colour put accent on accent and failed WCAG AA; the label carries full contrast instead. Mobile targets sit at 45px because a floor of exactly 44 rounds to 43.99997 in Firefox. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
512 lines
11 KiB
CSS
512 lines
11 KiB
CSS
/* CHRNX shell: stable, compact, and intentionally free of scroll animation. */
|
|
|
|
html[data-theme="light"] body {
|
|
background: var(--wp--preset--color--paper);
|
|
color: var(--wp--preset--color--ink);
|
|
}
|
|
|
|
html[data-theme="light"] h1,
|
|
html[data-theme="light"] h2,
|
|
html[data-theme="light"] h3,
|
|
html[data-theme="light"] h4,
|
|
html[data-theme="light"] h5,
|
|
html[data-theme="light"] h6 {
|
|
color: var(--wp--preset--color--ink);
|
|
}
|
|
|
|
@media (prefers-color-scheme: light) {
|
|
|
|
:root:not([data-theme]) {
|
|
color-scheme: light;
|
|
}
|
|
|
|
:root:not([data-theme]) body {
|
|
background: var(--wp--preset--color--paper);
|
|
color: var(--wp--preset--color--ink);
|
|
}
|
|
|
|
:root:not([data-theme]) h1,
|
|
:root:not([data-theme]) h2,
|
|
:root:not([data-theme]) h3,
|
|
:root:not([data-theme]) h4,
|
|
:root:not([data-theme]) h5,
|
|
:root:not([data-theme]) h6 {
|
|
color: var(--wp--preset--color--ink);
|
|
}
|
|
}
|
|
|
|
header.wp-block-template-part {
|
|
position: sticky;
|
|
z-index: 100;
|
|
top: 0;
|
|
background: color-mix(in srgb, var(--wp--preset--color--night) 94%, transparent);
|
|
border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--muted) 40%, transparent);
|
|
backdrop-filter: blur(12px);
|
|
}
|
|
|
|
html[data-theme="light"] header.wp-block-template-part {
|
|
background: color-mix(in srgb, var(--wp--preset--color--paper) 94%, transparent);
|
|
border-bottom-color: var(--wp--preset--color--border);
|
|
}
|
|
|
|
@media (prefers-color-scheme: light) {
|
|
|
|
:root:not([data-theme]) header.wp-block-template-part {
|
|
background: color-mix(in srgb, var(--wp--preset--color--paper) 94%, transparent);
|
|
border-bottom-color: var(--wp--preset--color--border);
|
|
}
|
|
}
|
|
|
|
.chrnx-site-header__inner,
|
|
.chrnx-site-footer__inner {
|
|
gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
|
|
max-width: var(--wp--style--global--wide-size);
|
|
margin-inline: auto;
|
|
padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
|
|
}
|
|
|
|
.chrnx-site-footer__inner {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding-block: clamp(1.5rem, 3vw, 2.5rem);
|
|
}
|
|
|
|
.chrnx-skip-link {
|
|
position: fixed;
|
|
z-index: 1000;
|
|
top: var(--wp--preset--spacing--20);
|
|
left: var(--wp--preset--spacing--20);
|
|
padding: 0.75rem 1rem;
|
|
transform: translateY(-200%);
|
|
background: var(--wp--preset--color--green);
|
|
color: var(--wp--preset--color--night);
|
|
font-weight: 700;
|
|
}
|
|
|
|
.chrnx-skip-link:focus {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.chrnx-site-brand {
|
|
display: flex;
|
|
align-items: center;
|
|
min-width: 45px;
|
|
min-height: 45px;
|
|
}
|
|
|
|
.chrnx-site-brand img {
|
|
width: clamp(8.5rem, 12vw, 10.5rem);
|
|
height: auto;
|
|
}
|
|
|
|
/* One icon language in the header: no resting outline, chip on hover/focus. */
|
|
.chrnx-mobile-menu-toggle,
|
|
.chrnx-header-search button,
|
|
.chrnx-theme-control > [data-chrnx-theme-button] {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-width: 45px;
|
|
min-height: 45px;
|
|
padding: 0;
|
|
border: 0;
|
|
border-radius: 0.35rem;
|
|
background: transparent;
|
|
color: inherit;
|
|
font: inherit;
|
|
cursor: pointer;
|
|
opacity: 0.65;
|
|
}
|
|
|
|
.chrnx-mobile-menu-toggle:hover,
|
|
.chrnx-mobile-menu-toggle[aria-expanded="true"],
|
|
.chrnx-header-search button:hover,
|
|
.chrnx-theme-control > [data-chrnx-theme-button]:hover,
|
|
.chrnx-theme-control > [data-chrnx-theme-button][aria-expanded="true"] {
|
|
background: color-mix(in srgb, var(--wp--preset--color--green) 24%, transparent);
|
|
color: var(--wp--preset--color--text);
|
|
opacity: 1;
|
|
}
|
|
|
|
html[data-theme="light"] .chrnx-mobile-menu-toggle:hover,
|
|
html[data-theme="light"] .chrnx-mobile-menu-toggle[aria-expanded="true"],
|
|
html[data-theme="light"] .chrnx-header-search button:hover,
|
|
html[data-theme="light"] .chrnx-theme-control > [data-chrnx-theme-button]:hover,
|
|
html[data-theme="light"] .chrnx-theme-control > [data-chrnx-theme-button][aria-expanded="true"] {
|
|
background: color-mix(in srgb, var(--wp--preset--color--light-green) 20%, transparent);
|
|
color: var(--wp--preset--color--ink);
|
|
}
|
|
|
|
@media (prefers-color-scheme: light) {
|
|
|
|
:root:not([data-theme]) .chrnx-mobile-menu-toggle:hover,
|
|
:root:not([data-theme]) .chrnx-mobile-menu-toggle[aria-expanded="true"],
|
|
:root:not([data-theme]) .chrnx-header-search button:hover,
|
|
:root:not([data-theme]) .chrnx-theme-control > [data-chrnx-theme-button]:hover,
|
|
:root:not([data-theme]) .chrnx-theme-control > [data-chrnx-theme-button][aria-expanded="true"] {
|
|
background: color-mix(in srgb, var(--wp--preset--color--light-green) 20%, transparent);
|
|
color: var(--wp--preset--color--ink);
|
|
}
|
|
}
|
|
|
|
/* The shared rule above sets display, so hidden must win back explicitly. */
|
|
.chrnx-mobile-menu-toggle[hidden],
|
|
.chrnx-theme-control > [data-chrnx-theme-button][hidden] {
|
|
display: none;
|
|
}
|
|
|
|
.chrnx-primary-navigation a,
|
|
.chrnx-footer-navigation a,
|
|
.chrnx-header-search input {
|
|
min-width: 45px;
|
|
min-height: 45px;
|
|
}
|
|
|
|
.chrnx-primary-navigation a,
|
|
.chrnx-footer-navigation a {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding-inline: 0.55rem;
|
|
}
|
|
|
|
.chrnx-primary-navigation ul {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
margin: 0;
|
|
padding: 0;
|
|
list-style: none;
|
|
}
|
|
|
|
.chrnx-header-search {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
width: auto;
|
|
}
|
|
|
|
.chrnx-header-search input {
|
|
box-sizing: border-box;
|
|
width: min(15rem, 45vw);
|
|
padding-inline: 0.75rem;
|
|
}
|
|
|
|
.chrnx-screen-reader-text {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border: 0;
|
|
}
|
|
|
|
.chrnx-theme-toggle {
|
|
display: none;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
min-width: 0;
|
|
margin: 0;
|
|
padding: 0;
|
|
border: 0;
|
|
}
|
|
|
|
.chrnx-theme-enhanced .chrnx-theme-toggle {
|
|
display: flex;
|
|
}
|
|
|
|
.chrnx-theme-toggle__legend {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border: 0;
|
|
}
|
|
|
|
/* No resting outline: the active choice reads as a filled chip instead. */
|
|
.chrnx-theme-toggle [data-chrnx-theme-value] {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-width: 45px;
|
|
min-height: 45px;
|
|
padding: 0;
|
|
border: 0;
|
|
border-radius: 0.35rem;
|
|
background: transparent;
|
|
color: inherit;
|
|
font: inherit;
|
|
cursor: pointer;
|
|
opacity: 0.65;
|
|
}
|
|
|
|
.chrnx-theme-toggle [data-chrnx-theme-value] svg {
|
|
width: 20px;
|
|
height: 20px;
|
|
}
|
|
|
|
.chrnx-theme-toggle [data-chrnx-theme-value]:hover {
|
|
opacity: 1;
|
|
}
|
|
|
|
/* Quiet chip, full-contrast label: accent-on-accent fails WCAG AA. */
|
|
.chrnx-theme-toggle [data-chrnx-theme-value][aria-pressed="true"] {
|
|
background: color-mix(in srgb, var(--wp--preset--color--green) 24%, transparent);
|
|
color: var(--wp--preset--color--text);
|
|
opacity: 1;
|
|
}
|
|
|
|
html[data-theme="light"] .chrnx-theme-toggle [data-chrnx-theme-value][aria-pressed="true"] {
|
|
background: color-mix(in srgb, var(--wp--preset--color--light-green) 20%, transparent);
|
|
color: var(--wp--preset--color--ink);
|
|
}
|
|
|
|
@media (prefers-color-scheme: light) {
|
|
|
|
:root:not([data-theme]) .chrnx-theme-toggle [data-chrnx-theme-value][aria-pressed="true"] {
|
|
background: color-mix(in srgb, var(--wp--preset--color--light-green) 20%, transparent);
|
|
color: var(--wp--preset--color--ink);
|
|
}
|
|
}
|
|
|
|
.js .chrnx-header-search[data-expanded="false"] input {
|
|
display: none;
|
|
}
|
|
|
|
.chrnx-theme-toggle output {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border: 0;
|
|
}
|
|
|
|
.chrnx-theme-noscript {
|
|
margin: 0;
|
|
font-size: var(--wp--preset--font-size--small);
|
|
}
|
|
|
|
main#chrnx-main {
|
|
min-height: 50vh;
|
|
padding-inline: var(--wp--preset--spacing--30);
|
|
}
|
|
|
|
footer.wp-block-template-part {
|
|
margin-top: var(--wp--preset--spacing--60);
|
|
border-top: 2px solid var(--chrnx-line);
|
|
background: var(--chrnx-surface);
|
|
}
|
|
|
|
html[data-theme="light"] footer.wp-block-template-part {
|
|
border-top-color: var(--chrnx-line);
|
|
}
|
|
|
|
@media (prefers-color-scheme: light) {
|
|
|
|
:root:not([data-theme]) footer.wp-block-template-part {
|
|
border-top-color: var(--chrnx-line);
|
|
}
|
|
}
|
|
|
|
.chrnx-site-footer__line,
|
|
.chrnx-site-footer__site,
|
|
.chrnx-site-footer__credit {
|
|
margin: 0;
|
|
font-size: var(--wp--preset--font-size--small);
|
|
}
|
|
|
|
.chrnx-footer-navigation ul {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: var(--wp--preset--spacing--20);
|
|
margin: 0;
|
|
padding: 0;
|
|
list-style: none;
|
|
}
|
|
|
|
@media (max-width: 780px) {
|
|
|
|
.chrnx-site-header__inner {
|
|
justify-content: flex-start;
|
|
}
|
|
|
|
.chrnx-primary-navigation {
|
|
margin-left: auto;
|
|
}
|
|
|
|
.chrnx-header-search {
|
|
order: 3;
|
|
flex: 1 1 10rem;
|
|
}
|
|
|
|
.chrnx-theme-toggle {
|
|
order: 4;
|
|
flex: 1 1 100%;
|
|
}
|
|
|
|
}
|
|
|
|
@media (max-width: 599px) {
|
|
|
|
.chrnx-site-header__inner {
|
|
display: grid !important;
|
|
grid-template-columns: minmax(0, 1fr) repeat(3, 45px);
|
|
gap: 0.25rem;
|
|
align-items: start;
|
|
padding-block: 0.75rem;
|
|
}
|
|
|
|
.chrnx-site-brand {
|
|
grid-row: 1;
|
|
grid-column: 1;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.chrnx-site-brand img {
|
|
max-width: 100%;
|
|
}
|
|
|
|
.chrnx-mobile-menu-toggle {
|
|
grid-row: 1;
|
|
grid-column: 4;
|
|
width: 45px;
|
|
height: 45px;
|
|
margin-left: 0;
|
|
}
|
|
|
|
.chrnx-primary-navigation {
|
|
grid-column: 1 / -1;
|
|
width: 100%;
|
|
margin-left: 0;
|
|
}
|
|
|
|
.chrnx-navigation-enhanced .chrnx-primary-navigation {
|
|
grid-row: 2;
|
|
}
|
|
|
|
.chrnx-primary-navigation[hidden] {
|
|
display: none;
|
|
}
|
|
|
|
.chrnx-primary-navigation ul {
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.chrnx-header-search {
|
|
display: grid;
|
|
grid-template-rows: 45px auto;
|
|
grid-template-columns: minmax(0, 1fr) repeat(3, 45px);
|
|
grid-column: 1 / -1;
|
|
gap: 0.25rem;
|
|
width: 100%;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.chrnx-navigation-enhanced .chrnx-header-search {
|
|
grid-row: 1;
|
|
}
|
|
|
|
.chrnx-header-search-row {
|
|
display: flex;
|
|
grid-row: 2;
|
|
grid-column: 1 / -1;
|
|
width: 100%;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.chrnx-header-search-row[hidden] {
|
|
display: none;
|
|
}
|
|
|
|
.chrnx-header-search input {
|
|
width: 100%;
|
|
}
|
|
|
|
.chrnx-header-search button {
|
|
grid-row: 1;
|
|
grid-column: 2;
|
|
width: 45px;
|
|
height: 45px;
|
|
padding: 0;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.chrnx-theme-control {
|
|
grid-column: 1 / -1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.chrnx-navigation-enhanced .chrnx-theme-control {
|
|
display: contents;
|
|
}
|
|
|
|
.chrnx-theme-control > [data-chrnx-theme-button] {
|
|
width: 45px;
|
|
height: 45px;
|
|
}
|
|
|
|
.chrnx-navigation-enhanced .chrnx-theme-control > [data-chrnx-theme-button] {
|
|
z-index: 2;
|
|
grid-row: 1;
|
|
grid-column: 3;
|
|
}
|
|
|
|
.chrnx-theme-control > [data-chrnx-theme-button][hidden],
|
|
.chrnx-navigation-enhanced .chrnx-theme-toggle[hidden] {
|
|
display: none;
|
|
}
|
|
|
|
.chrnx-navigation-enhanced .chrnx-theme-toggle {
|
|
z-index: 2;
|
|
grid-row: 2;
|
|
grid-column: 1 / -1;
|
|
justify-self: end;
|
|
flex-wrap: wrap;
|
|
width: fit-content;
|
|
max-width: 100%;
|
|
min-width: 0;
|
|
height: auto;
|
|
padding: 0.5rem;
|
|
border: 1px solid color-mix(in srgb, currentcolor 18%, transparent);
|
|
border-radius: 0.35rem;
|
|
background: var(--wp--preset--color--panel);
|
|
color: inherit;
|
|
box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 28%);
|
|
}
|
|
|
|
html[data-theme="light"].chrnx-navigation-enhanced .chrnx-theme-toggle {
|
|
background: var(--wp--preset--color--surface);
|
|
}
|
|
|
|
/*
|
|
* 45px, not 44: a floor set exactly at the WCAG minimum rounds to
|
|
* 43.99997px in Firefox and fails the target-size check.
|
|
*/
|
|
.chrnx-navigation-enhanced .chrnx-theme-toggle [data-chrnx-theme-value] {
|
|
flex: 1 1 auto;
|
|
min-width: 45px;
|
|
min-height: 45px;
|
|
white-space: normal;
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
|
|
.chrnx-skip-link {
|
|
transition: none;
|
|
}
|
|
}
|