Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions assets/css/doors/glossary.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ main:lang(ar) .post-nav-next .term-en{text-align:left}
@media(max-width:760px){
.glossary-hub .glossary-languages{display:none}
.glossary-language-select{display:flex;align-items:center;gap:10px;margin:14px 0 0;font:600 16px/1.3 var(--text)}
.glossary-language-select select{flex:1;padding:9px 12px;border:1.5px solid var(--ink);border-radius:var(--r-small);background:#fff;font:400 16px/1.3 var(--text);color:var(--ink)}
.glossary-language-select select{flex:1;min-width:0;padding:9px 12px;border:1.5px solid var(--ink);border-radius:var(--r-small);background:#fff;font:400 16px/1.3 var(--text);color:var(--ink)}
}
/* Two lines of definition per term on every screen, so each letter reads as an even block. */
.term-group li p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
Expand Down Expand Up @@ -146,8 +146,17 @@ main:lang(ar) .glossary-layout .article-style .term-definition p{font-size:21px}
order and its brackets inside right-to-left text. */
main:lang(ar) .crumbs a,main:lang(ar) .crumbs [aria-current]{unicode-bidi:isolate}
main:lang(ar) .glossary-layout .article-style a{unicode-bidi:plaintext}
/* A contributor's name is never split across lines. */
.glossary-layout .term-credit bdi.term-name{white-space:nowrap}
/* A contributor's name moves to the next line whole; it wraps inside only when it is wider than the column (text at 200%). */
.glossary-layout .term-credit bdi.term-name{display:inline-block;max-width:100%;white-space:normal}
/* Phones: only the search row stays pinned (DESIGN.md §9); the letters scroll away with the page. The toolbar box
gives way so the search row can stick for the whole list. Controls are 44 px targets. */
@media(max-width:760px){
.glossary-tools{display:contents}
.glossary-find{position:sticky;top:0;z-index:5;padding:6px 0 8px;background:var(--page);border-bottom:1px solid var(--line)}
.glossary-letters{margin-top:12px}
.glossary-clear,.glossary-view button,.term-filter-clear{min-height:44px}
.glossary-layout .language-switcher a{display:inline-flex;align-items:center;min-height:44px;box-sizing:border-box}
}
/* Arabic text is set at 21 px rather than 18 (article.css); its term lines and credits keep the same steps below it,
instead of taking the body size and outgrowing the definition's label. */
main:lang(ar) .glossary-layout .article-style .term-line{font-size:20px}
Expand Down
17 changes: 12 additions & 5 deletions assets/js/doors/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,18 @@ if (termFilter && termGrid) {
const tools = document.querySelector('.glossary-tools');
// A page opened at a letter (#letter-…) scrolled before the toolbar was measured, so it scrolls there once more.
let aligned = false;
if (tools) new ResizeObserver(() => {
document.documentElement.style.setProperty('--glossary-tools', `${tools.offsetHeight}px`);
if (!aligned && location.hash.startsWith('#letter-')) document.getElementById(location.hash.slice(1))?.scrollIntoView();
aligned = true;
}).observe(tools);
// On a phone the toolbar box gives way (display: contents) and only the search row is pinned, so that row is measured.
const find = document.querySelector('.glossary-find');
const pinned = () => (getComputedStyle(tools).display === 'contents' ? find : tools);
if (tools && find) {
const measure = new ResizeObserver(() => {
document.documentElement.style.setProperty('--glossary-tools', `${pinned().offsetHeight}px`);
if (!aligned && location.hash.startsWith('#letter-')) document.getElementById(location.hash.slice(1))?.scrollIntoView();
aligned = true;
});
measure.observe(tools);
measure.observe(find);
}
// The glossary hub: match on the term's name, hide letters left empty, and say when nothing matches.
const terms = [...termGrid.querySelectorAll('li[data-term]')];
const groups = [...termGrid.querySelectorAll('.term-group')];
Expand Down
Loading