diff --git a/apps.html b/apps.html index d84a5cec..db57c1ff 100644 --- a/apps.html +++ b/apps.html @@ -18,7 +18,7 @@ h1 { font-size:1.9rem; margin:.4rem 0 .3rem; } header p { color:var(--sub); max-width:34rem; margin:0 auto; } main { max-width:1100px; margin:0 auto; padding:1rem 1.5rem 4rem; } - .grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:1rem; } + .grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr)); gap:1rem; } .app-card { display:flex; gap:.9rem; padding:1rem; background:var(--card); border:1px solid var(--line); border-radius:12px; text-decoration:none; color:inherit; transition:transform .12s ease, box-shadow .12s ease; } .app-card:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(30,40,90,.12); } diff --git a/tests/apps-mobile-grid.test.mjs b/tests/apps-mobile-grid.test.mjs new file mode 100644 index 00000000..016bf339 --- /dev/null +++ b/tests/apps-mobile-grid.test.mjs @@ -0,0 +1,14 @@ +import test from "node:test"; +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; + +const source = readFileSync(fileURLToPath(new URL("../apps.html", import.meta.url)), "utf8"); +test("app catalog grid fits viewports narrower than the original 300px column", () => { + const css = source.match(/\.grid\s*\{[^}]*\}/)?.[0] ?? ""; + assert.match(css, /grid-template-columns:\s*repeat\(auto-fill,minmax\(min\(100%,300px\),1fr\)\)/); + assert.doesNotMatch(css, /minmax\(300px,1fr\)/); +}); +test("mobile page retains its responsive viewport setting", () => { + assert.match(source, //); +});