DWDitherweb
Architecture & GuidesVersion 0.1.0-alpha

Documentation

Learn how Ditherweb combines the unpolished authenticity of 1990s computing with modern React engineering standards, CSS custom properties, and accessible interaction patterns.

1. Quick Start

Ditherweb components are authored as clean, copy-pasteable React 19 primitives with zero black-box dependencies. They use standard React props and consume Tailwind CSS tokens.

UI Package Architecture (@ditherweb/ui)

All 10 core primitives and the cn(...) utility are exported directly from the package @ditherweb/ui:

import { Button, Input, Card, Badge, cn } from "@ditherweb/ui";
import "@ditherweb/ui/styles";

2. Design Token Architecture

Tokens are declared as CSS custom properties in app/globals.css. Dark mode is toggled cleanly by adding or removing the .dark class on <html>.

Semantic Color Tokens
  • --background: Page substrate canvas
  • --surface: Elevated panel surface (#c0c0c0 / #252830)
  • --surface-sunken: Recessed control well
  • --primary: Accent blue (#000080 / #3366cc)
  • --secondary: Teal (#008080 / #208080)
  • --accent: Amber highlight (#cc6600)
  • --destructive: Error crimson (#cc0000)
Bevel Light & Dark Tokens
  • --bevel-light: Highlight edge (#ffffff / #404552)
  • --bevel-dark: Shadow edge (#808080 / #101216)
  • --bevel-face: Midtone face fill
  • --border: Hard pixel contour
  • --ring: High-visibility focus indicator

3. Tactile Bevel Primitives

Bevels are implemented with calibrated borders to produce the classic pseudo-3D look without heavy images or filters.

.bevel-raised

Simulates an elevated button or dialog box with top/left highlight.

.bevel-inset

Simulates a recessed input field or sunken panel well.

.bevel-pressed

Active depressed state applied to buttons and toggles on interaction.

4. Procedural Dither Patterns

Dither patterns in Ditherweb are procedural SVG data-URIs encoded directly into CSS. They use pixel-aligned SVG rectangles with shape-rendering="crispEdges" to ensure identical rendering across screens.

.bg-dither-fine
Dense 2x2 stipple
.bg-dither-medium
Ordered 4x4 matrix
.bg-dither-coarse
Sparse screen door
.bg-dither-diagonal
Hatching line matrix

5. Accessibility Standards

Early Web interfaces were often inaccessible by modern metrics. Ditherweb strictly couples authentic retro visuals with uncompromising modern accessibility:

  • Full keyboard navigation: Enter and Space on buttons, Arrow keys on RadioGroups, Space on Switches and Checkboxes.
  • Explicit ARIA attributes: role="switch", role="radiogroup", role="alert", aria-checked, aria-invalid.
  • High-contrast focus rings: focus-visible:outline-ring ensures focus indicators are always discernible in both light and dark modes.
  • Semantic HTML elements are used natively whenever possible (<button>, <input>, <label>).

6. Package Distribution Status

npm StatusDeferred / Not yet designed

In accordance with project architecture guidelines, standalone npm packaging, exports, and publishing infrastructure are intentionally deferred until the component system and documentation reach full maturity in Phase 6. Components are currently consumed directly within Next.js / React projects.

7. Project Phase Roadmap

Phase 0: Project Setup & Architecture BaselineCOMPLETE
Phase 1: Visual Foundation & Design TokensCOMPLETE
Phase 2: First 10 Core ComponentsCOMPLETE
Phase 2.5: Product Website & Showcase ArchitectureCOMPLETE
Phase 2.75: Architecture Separation & Visual QACOMPLETE
Phase 3: Interactive Overlays & Navigation (Dialog, Tabs, Select, Tooltip...)PENDING
Phase 4: Extended Library & Layout ArchetypesPENDING
Phase 5: Production Hardening, Cross-Browser & PerformancePENDING
Phase 6: Documentation, Ecosystem & PackagingPENDING