highlight: inline equation layout with responsive stacked fallback

- From and result now on one line: '1.00 Units = 0.09 OtherUnits'
- Same font size and color for both sides (pico-color, 600 weight)
- Container query switches to over-under at <420px with '= ' prefix on result line
- Separator '=' shown inline; muted color/normal weight to visually anchor the equation
- Removed old two-tier font sizing (small grey from, large blue result)
This commit is contained in:
Falkan
2026-03-17 10:47:27 -04:00
parent ee162fc0f7
commit 7ca0fc4032
2 changed files with 46 additions and 12 deletions

View File

@@ -95,25 +95,56 @@
overflow: hidden;
transition: border-color 0.2s ease;
text-align: center;
container-type: inline-size;
}
.highlighted-result.has-highlight {
border-color: var(--pico-primary);
}
.highlighted-equation-from {
font-size: clamp(0.85rem, 2vw, 1.1rem);
color: var(--color-text-muted, #888880);
font-variant-numeric: tabular-nums;
}
.highlighted-equation-equals {
font-size: clamp(1.2rem, 3.5vw, 2rem);
font-weight: 700;
color: var(--pico-primary);
/* Equation row: inline on wide screens, over-under on narrow */
.highlighted-equation {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-wrap: nowrap;
gap: 0.4em;
font-size: clamp(1rem, 2.5cqi, 1.5rem);
font-weight: 600;
font-variant-numeric: tabular-nums;
color: var(--pico-color);
word-break: break-all;
text-align: center;
max-width: 100%;
}
/* Switch to stacked layout when the container gets tight */
@container (max-width: 420px) {
.highlighted-equation {
flex-direction: column;
gap: 0.15em;
}
.highlighted-eq-sep {
display: none;
}
.highlighted-eq-to::before {
content: '= ';
color: var(--pico-muted-color, #888880);
font-weight: 400;
}
}
.highlighted-eq-from,
.highlighted-eq-to {
/* same size, same color — both use the container-relative font above */
}
.highlighted-eq-sep {
color: var(--pico-muted-color, #888880);
font-weight: 400;
}
.highlighted-symbol {