diff options
| author | Leitwolf11 | 2026-11-16 12:38:10 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-11-16 12:38:10 +0300 |
| commit | 4ee77681379619b3fab7b8b33446a67164216cc8 (patch) | |
| tree | e270ad6dc86200cc79cbdccfa1ef6de1da8aff0d | |
| parent | 82f0c44dd3ae571bcbed1dccd4e7d9aa3450bdb4 (diff) | |
| download | tazel.net-4ee77681379619b3fab7b8b33446a67164216cc8.tar.gz | |
Drop the text direction four left-to-right languages do not needcontent/new-tazel
Every language of the site runs left to right, so the page sets
dir="ltr" itself: textDirection, its unused parameter, its test and the
right-to-left rules of the docs tree and the home arrows go. The width
media queries use the range notation.
Claude-Session: https://claude.ai/code/session_01Ji7xZMYjc4zankoc7hGBE1
| -rw-r--r-- | app/assets/site.css | 4 | ||||
| -rw-r--r-- | app/components/DocsTree.vue | 4 | ||||
| -rw-r--r-- | app/components/SiteFooter.vue | 2 | ||||
| -rw-r--r-- | app/components/SiteHeader.vue | 2 | ||||
| -rw-r--r-- | app/composables/useSiteLocale.ts | 7 | ||||
| -rw-r--r-- | app/content/locales.ts | 5 | ||||
| -rw-r--r-- | app/pages/[[locale]]/docs/[...slug].vue | 4 | ||||
| -rw-r--r-- | app/pages/[[locale]]/index.vue | 10 | ||||
| -rw-r--r-- | tests/locales.test.mjs | 12 |
9 files changed, 12 insertions, 38 deletions
diff --git a/app/assets/site.css b/app/assets/site.css index 4c1d4cc..9594370 100644 --- a/app/assets/site.css +++ b/app/assets/site.css @@ -239,7 +239,7 @@ pre { line-height: 1.65; } -@media (max-width: 720px) { +@media (width <= 720px) { .section { padding-block: 60px; } @@ -325,7 +325,7 @@ pre { } /* On a phone a path can be wider than the column: there code breaks where it must. */ -@media (max-width: 600px) { +@media (width <= 600px) { .prose :not(pre) > code { white-space: normal; overflow-wrap: anywhere; diff --git a/app/components/DocsTree.vue b/app/components/DocsTree.vue index 32d0312..83c02a9 100644 --- a/app/components/DocsTree.vue +++ b/app/components/DocsTree.vue @@ -77,10 +77,6 @@ summary svg { transition: transform 0.15s; } -:root[dir="rtl"] summary svg { - transform: scaleX(-1); -} - details[open] > summary svg { transform: rotate(90deg); } diff --git a/app/components/SiteFooter.vue b/app/components/SiteFooter.vue index 0fedd14..24986d6 100644 --- a/app/components/SiteFooter.vue +++ b/app/components/SiteFooter.vue @@ -100,7 +100,7 @@ a:hover { margin: 0; } -@media (max-width: 760px) { +@media (width <= 760px) { .grid { grid-template-columns: 1fr 1fr; } diff --git a/app/components/SiteHeader.vue b/app/components/SiteHeader.vue index 304f74b..924af82 100644 --- a/app/components/SiteHeader.vue +++ b/app/components/SiteHeader.vue @@ -201,7 +201,7 @@ watch( font-size: 0.94rem; } -@media (max-width: 760px) { +@media (width <= 760px) { .links { display: none; } diff --git a/app/composables/useSiteLocale.ts b/app/composables/useSiteLocale.ts index 1596751..45e3885 100644 --- a/app/composables/useSiteLocale.ts +++ b/app/composables/useSiteLocale.ts @@ -7,7 +7,6 @@ import { localePath, locales, pageOfPath, - textDirection, type Locale, } from "~/content/locales"; import { siteUrl } from "~/content/site"; @@ -25,14 +24,14 @@ export function useSiteLocale() { } /** - * The head of a page: its title and description, the language and direction of the document, - * and the address of the page in every language. + * The head of a page: its title and description, the language of the document, which runs left + * to right in every language of the site, and the address of the page in every language. */ export function usePageHead(text: () => { title: string; description: string }) { const { locale, page } = useSiteLocale(); const url = (target: Locale) => `${siteUrl}${localePath(target, page.value)}`; useHead(() => ({ - htmlAttrs: { lang: locale.value, dir: textDirection(locale.value) }, + htmlAttrs: { lang: locale.value, dir: "ltr" }, link: [ { rel: "canonical", href: url(locale.value) }, ...locales.map((target) => ({ diff --git a/app/content/locales.ts b/app/content/locales.ts index 0e742e2..2f633a1 100644 --- a/app/content/locales.ts +++ b/app/content/locales.ts @@ -57,8 +57,3 @@ export function pageOfPath(path: string): string { } return trimmed; } - -/** The direction the text of a language runs in: every language of the site runs left to right. */ -export function textDirection(_locale: Locale): "ltr" | "rtl" { - return "ltr"; -} diff --git a/app/pages/[[locale]]/docs/[...slug].vue b/app/pages/[[locale]]/docs/[...slug].vue index 84ec522..a0490a0 100644 --- a/app/pages/[[locale]]/docs/[...slug].vue +++ b/app/pages/[[locale]]/docs/[...slug].vue @@ -247,7 +247,7 @@ h1 { text-decoration: none; } -@media (max-width: 1180px) { +@media (width <= 1180px) { .docs-layout { grid-template-columns: 240px minmax(0, 1fr); } @@ -257,7 +257,7 @@ h1 { } } -@media (max-width: 860px) { +@media (width <= 860px) { .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; diff --git a/app/pages/[[locale]]/index.vue b/app/pages/[[locale]]/index.vue index af7a923..90d7a12 100644 --- a/app/pages/[[locale]]/index.vue +++ b/app/pages/[[locale]]/index.vue @@ -142,12 +142,6 @@ const headline = computed(() => { text-decoration: none; } -/* The arrow points onward in the reading direction. */ -:root[dir="rtl"] .arrow { - display: inline-block; - transform: scaleX(-1); -} - .badge { padding: 2px 10px; border-radius: 999px; @@ -354,7 +348,7 @@ h1 { color: #c9dde1; } -@media (max-width: 960px) { +@media (width <= 960px) { .hero-grid, .sample { grid-template-columns: 1fr; @@ -373,7 +367,7 @@ h1 { } } -@media (max-width: 640px) { +@media (width <= 640px) { .hero { padding-block: 56px 64px; } diff --git a/tests/locales.test.mjs b/tests/locales.test.mjs index 81c9690..a0beb97 100644 --- a/tests/locales.test.mjs +++ b/tests/locales.test.mjs @@ -4,13 +4,7 @@ import assert from "node:assert/strict"; import test from "node:test"; -import { - localeOfPrefix, - localePath, - locales, - pageOfPath, - textDirection, -} from "../app/content/locales.ts"; +import { localeOfPrefix, localePath, locales, pageOfPath } from "../app/content/locales.ts"; test("English has no prefix and the other languages have one", () => { assert.equal(localePath("en-US", "/"), "/"); @@ -37,7 +31,3 @@ test("a segment that is no prefix names no language", () => { assert.equal(localeOfPrefix("docs"), undefined); assert.equal(localeOfPrefix("en"), undefined); }); - -test("every language runs from left to right", () => { - assert.deepEqual(locales.map(textDirection), ["ltr", "ltr", "ltr", "ltr"]); -}); |