style: polish responsive typography and transcript states
Deploy Speaking Practice / deploy (push) Successful in 2m13s
Deploy Speaking Practice / deploy (push) Successful in 2m13s
This commit is contained in:
1 parent
cd29764963
commit
67dcea21d0
10 files changed
+291
-75
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { dirname, join } from "node:path";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const html = readFileSync(join(__dirname, "..", "index.html"), "utf8");
|
||||
|
||||
assert.equal(
|
||||
html.includes('<a class="primary-link" href="./study.html">进入学习页</a>'),
|
||||
false,
|
||||
);
|
||||
@@ -0,0 +1,31 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const css = readFileSync(join(__dirname, "..", "styles.css"), "utf8");
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/@media\s*\(max-width:\s*720px\)[\s\S]*\.home-topbar\s*\{[\s\S]*position:\s*static;/,
|
||||
"mobile home topbar should not remain sticky and tall above the content",
|
||||
);
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/@media\s*\(max-width:\s*720px\)[\s\S]*\.home-topbar\s+\.top-actions\s*\{[\s\S]*display:\s*grid;[\s\S]*grid-template-columns:\s*minmax\(0,\s*1fr\)\s+auto;/,
|
||||
"mobile top actions should keep search and account controls compact",
|
||||
);
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/@media\s*\(max-width:\s*720px\)[\s\S]*\.home-metrics\s*\{[\s\S]*grid-template-columns:\s*1fr;/,
|
||||
"mobile dashboard metrics should use one readable column",
|
||||
);
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/\.home-favorite\s*\{[\s\S]*min-width:\s*44px;[\s\S]*min-height:\s*44px;/,
|
||||
"favorite buttons should meet mobile touch target sizing",
|
||||
);
|
||||
@@ -0,0 +1,25 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const css = readFileSync(join(__dirname, "..", "styles.css"), "utf8");
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/\.line-button\.is-practiced\s*\{[\s\S]*background:\s*#ecfdf3;[\s\S]*border-color:\s*#86efac;[\s\S]*box-shadow:\s*inset 3px 0 0 #16a34a;/,
|
||||
"practiced transcript rows should use a clear green row highlight",
|
||||
);
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/\.line-button\.is-difficult\s*\{[\s\S]*background:\s*#fffaf0;[\s\S]*box-shadow:\s*inset 3px 0 0 var\(--gold\);/,
|
||||
"difficult transcript rows should keep the existing gold row highlight",
|
||||
);
|
||||
|
||||
assert.doesNotMatch(
|
||||
css,
|
||||
/\.line-status-button\.practiced\.active\s*\{[\s\S]*#16a34a/,
|
||||
"the stronger practiced color should belong to the transcript row, not the status button",
|
||||
);
|
||||
@@ -0,0 +1,31 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const css = readFileSync(join(__dirname, "..", "styles.css"), "utf8");
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/--font-sans:\s*Inter,\s*"Noto Sans SC",\s*"Microsoft YaHei UI",\s*"PingFang SC"/,
|
||||
"global font stack should pair polished Latin and Chinese UI fonts",
|
||||
);
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/body\s*\{[\s\S]*font-family:\s*var\(--font-sans\);[\s\S]*line-height:\s*1\.5;[\s\S]*text-rendering:\s*optimizeLegibility;[\s\S]*-webkit-font-smoothing:\s*antialiased;/,
|
||||
"body should use the shared font stack with improved rendering",
|
||||
);
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/\.brand h1\s*\{[\s\S]*font-weight:\s*760;[\s\S]*letter-spacing:\s*0;/,
|
||||
"brand title should use a refined strong weight",
|
||||
);
|
||||
|
||||
assert.match(
|
||||
css,
|
||||
/\.home-card-body h3\s*\{[\s\S]*font-weight:\s*760;[\s\S]*line-height:\s*1\.35;/,
|
||||
"home card titles should be less heavy and easier to scan",
|
||||
);
|
||||
Reference in new issue
Block a user