From ed7de0d17cdca94ff95e4bbc8076f36e777926c3 Mon Sep 17 00:00:00 2001 From: Eyal Gruss Date: Sun, 28 Jan 2024 16:21:49 +0200 Subject: [PATCH] fix media queries --- resen/pages.js | 11 +++++++++-- resen/style.css | 14 +++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/resen/pages.js b/resen/pages.js index b30d829..adbda8b 100644 --- a/resen/pages.js +++ b/resen/pages.js @@ -129,7 +129,14 @@ const collator = Intl.Collator(document.documentElement.lang, {numeric: true}) function reorder(list_of_strings, lang='', labels=kw_labels) { - return [...new Set(list_of_strings)].map(String).sort((a, b) => {const issues = !!b.match(/^\d+$/) - !!(a.match(/^\d+$/)); if (!lang) a = labels[a] ?? a, b = labels[b] ?? b; return issues || collator.compare(a, b)}) + return [...new Set(list_of_strings)].map(String).sort((a, b) => { + const issues = !!b.match(/^\d+$/) - !!(a.match(/^\d+$/)) + if (!lang) { + a = labels[a] ?? a + b = labels[b] ?? b + } + return issues || collator.compare(a, b) + }) } @@ -406,7 +413,7 @@ function make_header(reorder_contents=default_reorder_contents, new_tab_for_soci document.title = titles.label let index_title = get_set_titles('/', lang).label let is_mobile = false; - if (matchMedia('max-width: 480px').matches) { + if (matchMedia('(max-width: 480px)').matches) { index_title = index_title.split(' ').slice(0, lang ? 1 : 2).join(' ') is_mobile = true; } diff --git a/resen/style.css b/resen/style.css index 45f50df..164653c 100644 --- a/resen/style.css +++ b/resen/style.css @@ -1,9 +1,3 @@ -@font-face { - font-family: 'Alef Mono'; - font-display: block; - src: url('Alef-Monospace.woff2'); -} - :root, ::backdrop { /* In Chrome ::backdrop does not inherit from :root. See: https://bugs.chromium.org/p/chromium/issues/detail?id=827397 */ --bg: #f6e5d5; --fg_rgb: 0 0 0; @@ -40,6 +34,12 @@ background-color: var(--complementary); } +@font-face { + font-family: 'Alef Mono'; + font-display: block; + src: url('Alef-Monospace.woff2'); +} + html { scroll-padding-block: 5rem 3rem; } @@ -887,7 +887,7 @@ a.sponsors { } } -@media max-width: 480px { +@media (max-width: 480px) { blockquote, li, p:not(.story) { text-align: start; }