fix(studio): a rail label wraps between words, never inside one

The rail gave its labels 48px and let them break anywhere, so Elements read Element and s, and nine languages broke a word at the default text size. Labels wrap only between words now, and the rail grows to its longest word from 64px.
This commit is contained in:
Maurice
2026-10-25 03:12:21 +00:00
parent 3681db6cd4
commit 4051af58a7
4 changed files with 71 additions and 20 deletions
+13 -13
View File
@@ -211,16 +211,17 @@
.trek-dash .st-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 2px; flex: none; }
/* ----------------- body: rail | workbench | inspector ----------------- */
/* The rail is 64px, or as wide as the longest word in a section's name. */
.trek-dash .st-body {
display: grid;
grid-template-columns: 64px 236px minmax(0, 1fr) 300px;
grid-template-columns: minmax(64px, min-content) 236px minmax(0, 1fr) 300px;
min-height: 0;
}
/* Under 1280 the inspector floats over the workbench instead of narrowing it —
below roughly 700px of canvas a spread stops being legible at any zoom. */
@media (max-width: 1279px) {
.trek-dash .st-body { grid-template-columns: 64px 236px minmax(0, 1fr); }
.trek-dash .st-body { grid-template-columns: minmax(64px, min-content) 236px minmax(0, 1fr); }
.trek-dash .st-inspector {
position: absolute;
top: 56px;
@@ -231,12 +232,11 @@
}
}
@media (max-width: 1079px) {
.trek-dash .st-body { grid-template-columns: 64px minmax(0, 1fr); }
.trek-dash .st-body { grid-template-columns: minmax(64px, min-content) minmax(0, 1fr); }
/* The panel floats over the workbench's cell, so it starts wherever the rail ends. */
.trek-dash .st-side, .trek-dash .st-work-wrap { grid-area: 1 / 2; }
.trek-dash .st-side {
position: absolute;
top: 56px;
inset-inline-start: 64px;
bottom: 0;
justify-self: start;
width: 236px;
box-shadow: var(--sh-lg);
}
@@ -457,7 +457,6 @@
}
.trek-dash .st-rail-btn {
flex: none;
width: 52px;
min-height: 52px;
padding: 6px 2px;
display: flex;
@@ -469,9 +468,9 @@
color: var(--ink-3);
transition: background .16s, color .16s;
}
/* Two lines at most, broken inside a word that is longer than the rail is wide
("Путешествие", "Tərtibatlar"); the button's title carries the whole name. */
.trek-dash .st-rail-btn span {
/* Wrapped between words, never inside one: the rail grows to the longest word
("Maquetacions", "Путешествие"), and keep-all holds "コンテンツ" whole too. */
.trek-dash .st-rail-btn .st-rail-label {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
@@ -481,8 +480,9 @@
font-weight: 600;
line-height: 1.15;
text-align: center;
overflow-wrap: anywhere;
hyphens: auto;
overflow-wrap: normal;
word-break: keep-all;
hyphens: manual;
}
.trek-dash .st-rail-btn:focus { outline: none; }
.trek-dash .st-rail-btn:focus-visible { box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 3px var(--accent); }