Nappedia The mattress encyclopedia
design_services Source of truth

Nappedia Design Guidelines

This page defines the reusable design system for Nappedia: global chrome, tokens, components, table behavior, long-form layouts, and the first parent/child article template. New pages should reuse these patterns before adding page-specific CSS.

Source of truth Shared CSS first

Use base, layout, components, reading, and guide-template styles before adding page CSS.

Reusable template Parent and child guides

One implemented pattern now covers the mattress-types hub and memory-foam child page.

Validation standard Browser plus checks

Confirm desktop, mobile, table scrolling, header behavior, and CSS/JS file-size limits.

The design system exists to keep pages useful, dense, and maintainable.

Every page should help users make a mattress decision without relearning the interface. Shared components carry the visual system; page-specific CSS handles only truly local behavior.

Nappedia design principles
Principle Rule Why it matters
Evidence firstUse decision framing, comparison tables, evidence limits, details, and takeaway in that order for dense content.Readers can scan before committing to a long section.
Reusable by defaultUse shared stylesheets before page CSS.Prevents one-off layouts and keeps future pages predictable.
Crawlable contentKeep indexable article content in static HTML.Maintains the strongest SEO baseline for a static site.
Compact clarityFavor readable density over decoration.Mattress research pages need trust and speed, not spectacle.
Explicit limitsClaims must state mechanism, evidence type, uncertainty, implication, and edge case.Makes editorial judgment auditable.

Tokens live in styles-base.css and should be reused everywhere.

Token groups and required use
Token groupSourceRequired use
Color:root in styles-base.cssUse semantic tokens such as --text, --muted, --line, and --accent.
Spacing--space-1 through --space-8, --section-gapUse spacing tokens for padding, gaps, and major section rhythm.
Radius--radius-xs through --radius-xlCards and controls generally use 6-16px radius.
Width--shell, --shell-widePage content uses --shell; top navigation uses --shell-wide.
TypographyPlus Jakarta Sans and OutfitKeep letter spacing at 0. Do not use viewport-based font scaling.

Header, breadcrumbs, and footer must behave the same across tabs.

Shared page chrome standard
ElementStandard
HeaderSticky at the top of the viewport, 56px tall, defined in styles-base.css.
Top navigationPrimary tabs: Reviews, Scoring, Buying Guide, Size Guide, Quiz, Design Guidelines, Settings.
Header actionsOne primary action maximum in the top-right action area; secondary action only when it helps orientation.
BreadcrumbsUse the shared .breadcrumbs pattern below the header and above <main>.
FooterNo placeholder links. Footer links must point to existing pages only.
Scroll offsetAnchor targets use the shared top offset from styles-base.css.

Use component classes before inventing local styles.

Component class map
NeedComponent
Primary action.button
Secondary action.button-secondary
Tertiary action.button-tertiary
Content panel.section-card or .footer-card
Section header.section-head, .section-tag, .section-title, .section-blurb
Long-form table.table-wrap or .table-scroll containing .data-table or .guide-table
Sidebar TOC.sidebar, .toc-card, .toc-list, #toc-progress
Evidence note.evidence-note, optionally .warning or .success

Tables are the default for real comparisons.

Use tables for three or more comparable options, criteria, claims, or rules. Wrap wide tables so mobile users scroll the table, not the whole page.

Table columns must be parallel. Do not mix construction type, material, feature, certification, and marketing claim in the same taxonomy column unless the section explicitly explains the distinction.

Use one reusable structure for article families.

Add guide-template-page reading-page to the body and load styles-guide-template.css for parent hubs and child detail pages.

Required page role pattern
Page roleRequired pattern
Parent hubHero, summary band, table of contents, quick answer, comparison matrix, taxonomy rules, child-link section, fit/quality guidance, FAQ, sources.
Child detail pageHero, summary band, table of contents, quick answer, how it works, variants/details, best for/avoid, quality checklist, risks, buying checklist, FAQ, sources.
Internal linksParent hubs link down to live child pages. Child pages link up to the parent hub in the breadcrumb and first meaningful content area.
Planned pagesMention planned child pages as text only until the URL exists. Never create placeholder href="#" links.

Each page type has a clear layout role.

Page-type design standard
Page typeDesign standard
Review pageScore, price, trial/returns, and main CTA stay visible above the fold. Scope review-specific styles to .review-page.
Reviews indexDense review cards, clear reviewed vs coming-soon states, no placeholder links.
Long-form buying/scoring guideUse .reading-page, shared TOC, shared table wrappers, and evidence-first section order.
Parent/child guidesUse .guide-template-page and the parent/child template above.
Quiz/tool pagesTool appears in the first viewport; supporting science follows below.
Info/policy pagesUse .info-page reading-page; no TOC unless the page is long enough to need one.

Global rules belong in shared stylesheets, not page files.

Stylesheet ownership map
FileOwnership
styles-base.cssTokens, resets, typography basics, global header, navigation, buttons, labels.
styles-layout.cssPage shell, hero primitives, breadcrumbs, layout grid, sidebar, TOC, footer.
styles-components.cssReusable content components, cards, lists, score displays, FAQs, sources.
styles-reading.cssLong-form typography, article metadata, table wrappers, reading-page spacing.
styles-guide-template.cssParent/child guide page shell and reusable guide-specific blocks.
Page CSSOnly page-specific behavior that cannot be expressed with shared components.

Spacing should come from tokens and shared layout classes.

Spacing and layout rules
AreaRule
Major page sectionsUse var(--section-gap).
Content stacksUse .content-stack and shared grid gaps.
Adjacent content blocksLong-form cards need at least var(--space-5) between sibling callouts, fact cards, key takeaways, and comparable blocks.
Footer gapLet .site-footer own the pre-footer gap.
Mobile tablesParent containers must allow shrinking and table wrappers must scroll horizontally.

Design changes need browser checks and code hygiene checks.

Code checks

  • No CSS or JS file exceeds 500 lines; target under 400.
  • Run available syntax, lint, type, build, or smoke checks.
  • Update this page and DESIGN_GUIDELINES.md when reusable rules change.

Browser checks

  • Verify desktop and mobile layouts.
  • Check header, breadcrumbs, TOC, tables, footer, and sticky elements.
  • Confirm text does not overlap or overflow buttons/cards.

Content checks

  • Ensure tables compare parallel criteria.
  • Confirm child pages link to parent hubs.
  • Confirm no placeholder links ship on indexable pages.