Forráskód Böngészése

Align blog styling with the existing STRATA homepage

zhangwei123 1 hónapja
szülő
commit
a61bae39fd

+ 22 - 0
docs/editorial/blog-style-verification.md

@@ -0,0 +1,22 @@
+# Blog styling alignment — 2026-10-09
+
+Baseline: `4e4237e47cdfe7fc7e325aaa258c38322ecaf560`.
+
+The blog now follows the existing homepage's visual language: slate-50 background (#f8fafc), white surfaces, black text/2px borders, amber-300 (#fcd34d) emphasis, square corners and hard offset shadows. The server-rendered blog shell uses the same plane mark and compact monospace navigation treatment; headings are heavy uppercase sans-serif, controls are monospace, and long-form article copy remains sentence-case sans-serif. Cards, primary/secondary links, responsive spacing and footer navigation use the same treatment. Homepage components were inspected and the actual live homepage screenshot/computed tokens confirmed the reference.
+
+Only blog presentation files, a focused style checker and this verification record change. The homepage, existing Navbar/Footer, article JSON, metadata, indexing gate, routing, auth/payment code and business policies are unchanged. Active content SHA-256 remains `c83febff4928cc8e8e9861f9ea28de5b4d5a3d202e8c77f9752d9b0720c0d720`.
+
+Verified on the final source:
+
+- `node scripts/check-blog-style.mjs`: pass. Checks design tokens, borders/shadows, typography, responsive rules, focus/reduced-motion styles and server-localized shell.
+- `node scripts/check-blog.mjs`: pass. Existing content/SEO/publication fixtures remain intact.
+- `node_modules/.bin/tsc --noEmit --incremental false`: pass.
+- Focused ESLint over blog TypeScript components with the installed TypeScript parser/plugin and unused-variable/no-explicit-any rules: pass.
+- Default-noindex production build: pass. Existing build skips full lint.
+- Production HTTP suite: pass for four blog pages, 13 excluded/unknown routes, ten existing app GETs, canonical/schema/indexing/sitemap/header checks. No authenticated or payment flow was exercised.
+- Independent source review found no P0/P1 blocker. Follow-up fixes give the skip-link target keyboard focus and scroll clearance under the sticky header; footer labels wrap safely at narrow widths.
+- Homepage/content/metadata/auth/business file diff against the baseline is empty; `git diff --check` passes.
+
+Visual limitation: the real homepage was inspected, but the redesigned blog could not be visually inspected in this environment. Local Chromium launch remains unavailable. Actual SSR snapshots with inline built CSS were prepared outside the repository, but the separate browser explicitly disallowed file URLs; no workaround was attempted. Therefore rendered desktop/mobile layout, 320/390px wrapping and live keyboard interactions remain unverified. Structural CSS checks are not a screenshot or interactive QA pass.
+
+The pre-existing full-lint missing `next/core-web-vitals` configuration remains outside this styling scope. No push or deployment is included. This revision is handed off as a local Git commit/bundle for user review.

+ 41 - 0
scripts/check-blog-style.mjs

@@ -0,0 +1,41 @@
+import assert from 'node:assert/strict';
+import fs from 'node:fs';
+import postcss from 'postcss';
+const css = fs.readFileSync('src/components/blog/blog.css', 'utf8');
+const sheet = postcss.parse(css);
+const declarations = selector => {
+  const values = {};
+  sheet.walkRules(rule => { if (rule.selector === selector && rule.parent.type === 'root') rule.walkDecls(d => { values[d.prop] = d.value; }); });
+  return values;
+};
+const tokens = declarations('.blog-body');
+assert.equal(tokens['--blog-page'], '#f8fafc');
+assert.equal(tokens['--blog-surface'], '#ffffff');
+assert.equal(tokens['--blog-ink'], '#000000');
+assert.equal(tokens['--blog-accent'], '#fcd34d');
+assert.equal(tokens['--blog-accent-hover'], '#fbbf24');
+assert.equal(tokens['--blog-line'], '2px solid var(--blog-ink)');
+assert.equal(tokens['--blog-shadow'], '4px 4px 0 var(--blog-ink)');
+assert.equal(declarations('.blog-header-inner')['min-height'], '64px');
+assert.equal(declarations('.blog-hero')['box-shadow'], '8px 8px 0 var(--blog-ink)');
+assert.equal(declarations('.blog-main')['scroll-margin-top'], '88px');
+assert.equal(declarations('.blog-footer nav')['overflow-wrap'], 'anywhere');
+assert.equal(declarations('.blog-card').border, 'var(--blog-line)');
+assert.equal(declarations('.blog-footer').background, 'var(--blog-surface)');
+assert.equal(declarations('.blog-footer')['border-top'], 'var(--blog-line)');
+assert.equal(declarations('.blog-hero h1, .blog-article h1')['font-weight'], '900');
+assert.equal(declarations('.blog-hero h1, .blog-article h1')['text-transform'], 'uppercase');
+assert.equal(declarations('.blog-prose')['font-size'], '17px');
+assert(!/#(?:f5f3ed|172523|24765e|3d6659|e6ebdd|315a49|215c45)\b/i.test(css), 'Old cream/green palette must not return');
+sheet.walkDecls('border-radius', d => assert(/^0(?:px)?$/.test(d.value), 'Homepage uses square corners'));
+const media = [];
+sheet.walkAtRules('media', rule => media.push(rule.params));
+assert(media.includes('(max-width: 1023px)') && media.includes('(max-width: 639px)'));
+assert(media.includes('(prefers-reduced-motion: reduce)'));
+assert(css.includes('.blog-body a:focus-visible'));
+const shell = fs.readFileSync('src/components/blog/BlogShell.tsx', 'utf8');
+assert(shell.includes('blog-brand-mark') && shell.includes('<Plane size={16}'));
+assert(!shell.includes('use client'), 'Do not reintroduce browser-dependent language state');
+assert(shell.includes('tabIndex={-1}'), 'Skip link target must accept focus');
+assert(shell.includes('{t.disclaimer}'), 'Keep independent-service disclosure');
+console.log('PASS: homepage-matched slate/white/black/amber tokens, square borders, hard shadows, typography, responsive rules, focus and reduced-motion styles; server-localized shell. Structural checks are not rendered visual QA.');

+ 24 - 6
src/components/blog/BlogShell.tsx

@@ -1,18 +1,36 @@
 import type { ReactNode } from 'react';
+import { BookOpen, Briefcase, Plane } from 'lucide-react';
 import type { BlogLocale } from '@/lib/blog/types';
 import { blogPath, indexingEnabled } from '@/lib/blog/data';
 import { copy } from '@/lib/blog/translations';
 
+function BlogBrand() {
+  return <a className="blog-brand" href="/" aria-label="STRATA">
+    <span className="blog-brand-mark" aria-hidden="true"><Plane size={16} /></span>
+    <span className="blog-brand-name"><strong>STRATA</strong><small>[ VAS DIRECTORY ]</small></span>
+  </a>;
+}
+
 export function BlogShell({ locale, children }: { locale: BlogLocale; children: ReactNode }) {
   const t = copy[locale];
   return <>
     <a className="blog-skip" href="#blog-main">{t.guides}</a>
-    <header className="blog-header">
-      <a className="blog-brand" href="/" aria-label="STRATA"><strong>STRATA</strong><small>[ VAS DIRECTORY ]</small></a>
-      <nav aria-label={t.guides}><a href={blogPath(locale)}>{t.guides}</a><a href="/services">{t.services}</a></nav>
-    </header>
+    <header className="blog-header"><div className="blog-header-inner">
+      <BlogBrand />
+      <nav aria-label={t.guides}>
+        <a className="blog-nav-active" href={blogPath(locale)}><BookOpen size={14} aria-hidden="true" />{t.guides}</a>
+        <a href="/services"><Briefcase size={14} aria-hidden="true" />{t.services}</a>
+      </nav>
+    </div></header>
     {!indexingEnabled && <p className="blog-preview" role="status">{t.preview}</p>}
-    <main id="blog-main" className="blog-main">{children}</main>
-    <footer className="blog-footer"><div><strong>STRATA · {t.independent}</strong><p>{t.disclaimer}</p><a href="/">{t.home}</a> · <a href="/services">{t.services}</a></div></footer>
+    <main id="blog-main" className="blog-main" tabIndex={-1}>{children}</main>
+    <footer className="blog-footer"><div className="blog-footer-inner">
+      <div className="blog-footer-grid">
+        <div><BlogBrand /><p>{t.disclaimer}</p></div>
+        <nav aria-label={t.guides}><strong>[ {t.guides} ]</strong><a href="/">{t.home}</a><a href={blogPath(locale)}>{t.guides}</a><a href="/services">{t.services}</a></nav>
+        <nav aria-label={t.terms}><strong>[ {t.terms} ]</strong><a href="/terms">{t.terms}</a><a href="/refund-policy">{t.refunds}</a></nav>
+      </div>
+      <div className="blog-footer-bottom">STRATA · {t.independent}</div>
+    </div></footer>
   </>;
 }

+ 1 - 1
src/components/blog/BlogViews.tsx

@@ -35,7 +35,7 @@ export function BlogArticleView({ article }: { article: BlogArticle }) {
       <div className="blog-prose"><ReactMarkdown remarkPlugins={[remarkGfm]} skipHtml>{article.body}</ReactMarkdown></div>
       <section className="blog-sources"><h2>{t.sources}</h2><ul>{article.sources.map(source => <li key={source.url}><a href={source.url} rel="noopener noreferrer">{source.title}</a></li>)}</ul></section>
     </article>
-    <aside className="blog-notice"><strong>{t.independent}</strong><p>{t.disclaimer}</p><a className="blog-button" href={article.officialBooking.url}>{article.officialBooking.label} ↗</a><p>{t.serviceNote} <a href="/terms">{t.terms}</a> · <a href="/refund-policy">{t.refunds}</a></p><a href="/services">{t.services} →</a></aside>
+    <aside className="blog-notice"><strong>{t.independent}</strong><p>{t.disclaimer}</p><a className="blog-button" href={article.officialBooking.url}>{article.officialBooking.label} ↗</a><p>{t.serviceNote} <a href="/terms">{t.terms}</a> · <a href="/refund-policy">{t.refunds}</a></p><a className="blog-service-link" href="/services">{t.services} →</a></aside>
     {related.length > 0 && <section className="blog-related"><h2>{t.related}</h2><ul>{related.map(a => <li key={a.id}><a href={articlePath(a)}>{a.title} →</a></li>)}</ul></section>}
   </>;
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
src/components/blog/blog.css


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott