How vectordxy/stayedcss works
Main Components
a) Core Processing Layer:
• Style Generation System (/src/styles/generate)
• Syntax Processing System (/src/styles/syntax)
• Type System (/src/types)
b) Client Integration Layer:
• Client API (/src/main/client/api)
• Static API (/src/main/static/api)
c) Style Processing Pipeline:
• Style Generation
• Syntax Checking
• CSS Output
┌─ Application Layer ─────────────────┐
• Next.js App (Server/Client Components) │
• ┬────────────────────┘
• ↓
┌─ StayedCSS API Layer ──────────────┐
• useStyle() │
• useClientStyle() │
• changeScreenMode() │
• ┬────────────────────┘
• ↓
┌─ Processing Layer ────────────────┐
• ┌─ Style Generation ─┐ │
• Class Names │ │
• Style Rules │ │
• ┘ │
• ┌─ Syntax Processing ┐ │
• Combinators │ │
• Pseudo Classes │ │
• Media Queries │ │
• ┘ │
• ┬────────────────┘
• ↓
┌─ Output Layer ──────────────────┐
• Static CSS Generation │
• ┘
Important Relationships
• Flow of style processing from input through syntax checking to final CSS generation
• Separation between server and client components
• Dark mode transition handling
Technical Details
• Support for CSS-like syntax
• Breakpoint handling system
• Media query processing
• Pseudo-class/element support
• Component ID management
• Static/Dynamic style generation