Refine shared header language selector
This commit is contained in:
+73
-25
@@ -1,32 +1,80 @@
|
||||
/* Persistent language choice, also available before login. */
|
||||
.language-switch {
|
||||
/* Shared language/account controls, including pages shown before login. */
|
||||
.header-controls {
|
||||
position: relative;
|
||||
z-index: 2000;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
margin-left: auto;
|
||||
}
|
||||
.language-switch { position: relative; flex: 0 0 auto; margin: 0; padding: 0; }
|
||||
.language-switch > summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 0 0 auto;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
gap: 5px;
|
||||
min-height: 44px;
|
||||
padding: 6px 8px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 9px;
|
||||
color: var(--muted, #57534e);
|
||||
background: transparent;
|
||||
font: 500 .85rem/1.2 system-ui, sans-serif;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
}
|
||||
.language-switch a {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 38px;
|
||||
height: 36px;
|
||||
border: 1px solid var(--border, #30363d);
|
||||
border-radius: 8px;
|
||||
color: var(--text, #222);
|
||||
font-family: system-ui, sans-serif;
|
||||
font-size: 1.2rem;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
.language-switch > summary::-webkit-details-marker { display: none; }
|
||||
.language-caret { font-size: .7rem; }
|
||||
.language-switch[open] > summary,
|
||||
.language-switch > summary:active { color: var(--text, #f5f5f4); background: var(--surface-hover, #1a1111); border-color: var(--border, #3a3030); }
|
||||
.language-panel {
|
||||
position: absolute;
|
||||
top: calc(100% + 6px);
|
||||
right: 0;
|
||||
z-index: 10000;
|
||||
width: 200px;
|
||||
max-width: calc(100vw - 24px);
|
||||
padding: 6px;
|
||||
border: 1px solid var(--border, #3a3030);
|
||||
border-radius: 10px;
|
||||
color: var(--text, #f5f5f4);
|
||||
background: var(--surface, #101010);
|
||||
box-shadow: 0 14px 35px rgba(0,0,0,.65);
|
||||
}
|
||||
.language-switch a.active { background: #922525; color: #fff; border-color: #c74747; }
|
||||
.language-switch a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
|
||||
.language-switch a:hover { background: #7f1d1d; }
|
||||
.header-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; }
|
||||
.header-controls .user-menu { margin-left: 0; }
|
||||
.language-heading { margin: 0; padding: 8px 10px; font-size: .8rem; color: var(--muted, #a8a29e); }
|
||||
.language-panel a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 6px; color: inherit; font: 400 .9rem/1.3 system-ui, sans-serif; text-decoration: none; }
|
||||
.language-panel a[aria-current] { background: var(--surface-hover, #1a1111); font-weight: 700; }
|
||||
.language-selected { margin-left: auto; }
|
||||
.language-switch summary:focus-visible { outline: 2px solid var(--text, #57534e); outline-offset: 2px; }
|
||||
.language-panel a:focus-visible,
|
||||
.header-controls .user-menu summary:focus-visible { outline: 2px solid var(--text, #f5f5f4); outline-offset: 2px; }
|
||||
@media (hover: hover) {
|
||||
.language-switch > summary:hover { color: var(--text, #f5f5f4); background: var(--surface-hover, #1a1111); border-color: var(--border, #3a3030); }
|
||||
.language-panel a:hover { background: var(--surface-hover, #1a1111); }
|
||||
}
|
||||
/* Both menus anchor to the same right edge, independent of the page header. */
|
||||
.header-controls .language-switch,
|
||||
.header-controls .user-menu { position: static; margin-left: 0; }
|
||||
.header-controls .user-menu { min-width: 0; }
|
||||
.header-controls .user-menu summary { display: flex; align-items: center; gap: 5px; min-height: 44px; max-width: 220px; }
|
||||
.user-menu-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.header-controls .metal-notification { flex-shrink: 0; margin-right: 7px; }
|
||||
.header-controls .user-menu-panel { position: absolute; top: calc(100% + 6px); right: 0; max-width: calc(100vw - 24px); max-height: calc(100dvh - 90px); overflow-y: auto; }
|
||||
.header-inner { gap: 8px; }
|
||||
.header-inner > .logo { min-width: 0; flex-shrink: 1; }
|
||||
.header-inner > .logo .brand-logo { max-width: 100% !important; }
|
||||
.header-inner > .language-switch { margin-left: auto; }
|
||||
.header-actions > .header-controls { flex: 0 0 auto; }
|
||||
.detail-topbar > .header-controls { flex: 0 0 auto; }
|
||||
.detail-topbar { align-items: center; padding-inline: 12px; }
|
||||
.detail-topbar > .back-link { min-width: 0; overflow-wrap: anywhere; }
|
||||
.detail-topbar > .header-controls { flex-shrink: 0; }
|
||||
.registration-header { display: flex; justify-content: flex-end; margin: -36px 0 12px; }
|
||||
@media (max-width: 600px) {
|
||||
.header-controls .user-menu summary { max-width: 30vw; padding: 8px; }
|
||||
.language-switch > summary { padding: 6px; }
|
||||
.detail-topbar { gap: 8px; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user