translations and pickers

This commit is contained in:
Mateusz Gruszczyński
2026-09-05 08:56:45 +02:00
parent e68ad69bc5
commit bf34a7cab1
18 changed files with 606 additions and 63 deletions
+224
View File
@@ -8102,3 +8102,227 @@ dialog::backdrop {
transform: none;
}
}
/* Compact interface preferences in application headers. */
.header-preferences {
display: flex;
align-items: center;
gap: 6px;
flex: 0 0 auto;
}
.header-preference-picker {
position: relative;
flex: 0 0 auto;
}
.header-preference-picker > summary {
list-style: none;
}
.header-preference-picker > summary::-webkit-details-marker {
display: none;
}
.header-preference-trigger {
display: inline-flex;
min-width: 38px;
height: 36px;
align-items: center;
justify-content: center;
gap: 6px;
padding: 0 9px;
border: 1px solid var(--border);
border-radius: 8px;
background: color-mix(in srgb, var(--surface-2) 78%, transparent);
color: var(--muted);
cursor: pointer;
user-select: none;
transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.header-preference-trigger:hover,
.header-preference-picker[open] > .header-preference-trigger {
border-color: var(--border-strong);
background: var(--surface-3);
color: var(--text);
}
.header-preference-trigger:focus-visible {
outline: 2px solid var(--focus);
outline-offset: 2px;
}
.header-preference-trigger__icon {
display: grid;
width: 17px;
height: 17px;
flex: 0 0 17px;
place-items: center;
}
.header-preference-trigger__icon svg {
width: 17px;
height: 17px;
fill: none;
stroke: currentColor;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 1.7;
}
.header-preference-trigger__value {
max-width: 72px;
overflow: hidden;
color: var(--text);
font-size: .72rem;
font-weight: 750;
line-height: 1;
text-overflow: ellipsis;
white-space: nowrap;
}
.header-preference-picker--language .header-preference-trigger__value {
min-width: 18px;
text-align: center;
letter-spacing: .04em;
}
.header-preference-trigger__chevron {
color: var(--muted-2);
font-size: .68rem;
line-height: 1;
transition: transform .14s ease;
}
.header-preference-picker[open] .header-preference-trigger__chevron {
transform: rotate(180deg);
}
.header-preference-menu {
position: absolute;
top: calc(100% + 7px);
right: 0;
z-index: 80;
display: grid;
width: max-content;
min-width: 164px;
max-width: min(260px, calc(100vw - 24px));
gap: 2px;
padding: 5px;
border: 1px solid var(--border-strong);
border-radius: 10px;
background: var(--surface-floating);
box-shadow: 0 14px 34px var(--shadow-38), inset 0 1px 0 var(--wash-soft);
}
.header-preference-picker--language .header-preference-menu {
min-width: 190px;
}
.header-preference-option {
display: grid;
grid-template-columns: 18px minmax(0, 1fr);
align-items: center;
gap: 7px;
width: 100%;
min-height: 36px;
padding: 6px 9px;
border: 1px solid transparent;
border-radius: 7px;
background: transparent;
color: var(--text);
text-align: left;
}
.header-preference-option:hover,
.header-preference-option:focus-visible {
border-color: var(--border-strong);
outline: 0;
background: var(--surface-hover);
}
.header-preference-option[aria-selected="true"] {
border-color: var(--accent-a35);
background: var(--accent-soft);
}
.header-preference-option__check {
display: grid;
width: 18px;
height: 18px;
place-items: center;
color: var(--accent-text);
font-size: .72rem;
font-weight: 900;
}
.header-preference-option__copy {
overflow: hidden;
font-size: .78rem;
font-weight: 650;
text-overflow: ellipsis;
white-space: nowrap;
}
.home-header {
justify-content: space-between;
}
@media (max-width: 720px) {
.header-preference-trigger {
min-width: 36px;
height: 34px;
padding-inline: 8px;
}
.header-preference-picker--theme .header-preference-trigger__value,
.header-preference-trigger__chevron {
display: none;
}
.public-header {
gap: 8px;
padding-block: 8px;
}
.public-header__actions {
justify-content: flex-end;
gap: 7px;
flex-wrap: wrap;
}
}
@media (max-width: 520px) {
.header-preferences {
gap: 4px;
}
.header-preference-trigger {
width: 34px;
min-width: 34px;
height: 34px;
padding: 0;
}
.header-preference-trigger__value {
display: none;
}
.header-preference-menu {
max-width: calc(100vw - 20px);
}
.public-header {
align-items: flex-start;
flex-wrap: wrap;
}
.public-header__actions {
width: 100%;
}
.public-header__actions .header-preferences {
margin-left: auto;
}
}