Skip to content

feat: design style guide + inline color swatches#37

Draft
nsheaps wants to merge 5 commits intomainfrom
claude/add-design-style-guide-tOY63
Draft

feat: design style guide + inline color swatches#37
nsheaps wants to merge 5 commits intomainfrom
claude/add-design-style-guide-tOY63

Conversation

@nsheaps
Copy link
Copy Markdown
Owner

@nsheaps nsheaps commented Mar 15, 2026

Summary

Two features that complement each other: a comprehensive design style guide document, and an inline color swatch renderer that brings the color values in that document (and any other page) to life.

1. Design & Style Guide (docs/content/reference/design-style-guide.md)

A 386-line reference document for contributors covering:

  • Color system — Light/dark mode palettes, brand/neutral/semantic colors, syntax highlighting, inline elements
  • Typography — System font stack, monospace stack, heading scale, line heights
  • Spacing & layout — 4px base grid, key dimensions, responsive breakpoints (768px/480px)
  • Shadows & elevation — 5 shadow levels, border radius scale
  • Iconography — Lucide React icons, sizing, accessibility rules
  • Interaction patterns — Light/dark mode, motion & animation, focus management
  • Platform considerations — Desktop, tablet, mobile input mode adaptation table
  • Accessibility checklist — WCAG 2.1 AA compliance, contributor pre-commit checklist
  • CSS architecture — File organization, Tailwind v4 conventions, --cept- prefix

Registered in:

  • docs/src/index.ts (metadata)
  • docs/content/index.md (navigation link)
  • packages/ui/src/components/docs/docs-content.ts (in-app docs space — visible in preview deployments)

2. Inline Color Swatches (CodeColorSwatch extension)

A TipTap ProseMirror plugin that auto-detects CSS color values inside inline code and renders a small colored square swatch to the left — like Chrome DevTools.

Supported formats:

  • Hex: #rgb, #rgba, #rrggbb, #rrggbbaa
  • Functions: rgb(), rgba(), hsl(), hsla(), oklch(), oklab(), lch(), lab(), hwb(), color()
  • Named: all 148 CSS named colors + transparent

How it works:

  • ProseMirror decoration plugin scans for code marks with color-like text
  • Renders a <span> widget decoration with background-color set to the detected value
  • Checkerboard background pattern reveals transparency in alpha colors
  • Dark mode border adaptation
  • Zero impact on markdown — no special syntax needed, standard backtick inline code

Files added:

  • extensions/color-utils.ts — Color detection with regex for all CSS color formats
  • extensions/code-color-swatch.ts — TipTap Extension with ProseMirror decoration plugin
  • extensions/color-utils.test.ts — 20 tests covering all color formats + edge cases
  • extensions/code-color-swatch.test.ts — 4 tests for extension structure

Changes

File Change
docs/content/reference/design-style-guide.md New: complete design reference
docs/content/index.md Link in Reference section
docs/src/index.ts Metadata registration
packages/ui/src/components/docs/docs-content.ts In-app docs: page tree, content, source path
packages/ui/src/components/editor/extensions/color-utils.ts New: CSS color detection
packages/ui/src/components/editor/extensions/code-color-swatch.ts New: swatch decoration plugin
packages/ui/src/components/editor/extensions/index.ts Exports
packages/ui/src/components/editor/CeptEditor.tsx Wire in CodeColorSwatch
packages/ui/src/components/editor/editor-styles.css Swatch CSS + dark mode

Test plan

  • All 1723 tests pass (bun run validate)
  • Lint passes
  • Typecheck passes
  • Color detection covers hex (3/4/6/8 digit), rgb/rgba, hsl/hsla, oklch, oklab, named colors
  • Rejects non-color inline code (no false positives)
  • Style guide CSS values verified against actual codebase
  • Visual verification: check swatches render in preview deployment
  • Verify checkerboard shows through transparent colors

https://claude.ai/code/session_01G7EiAdwAzdi7qzeYditnic

@nsheaps nsheaps self-assigned this Mar 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 15, 2026

Release Version Check

🟡 MINOR version bump

Version
Current 0.5.1
Next 0.6.0

This version will be released automatically when this PR is merged to main.

Changelog preview

0.6.0 (2026-03-23)

Features

Bug Fixes

  • editor: put checkerboard behind color swatch, not on top (c616b8c)

Documentation

  • add branding and design style guide (a47cf3b)
  • register design style guide in docs metadata (37f04ce)

@github-actions
Copy link
Copy Markdown
Contributor

Preview Deployment

The web app for this PR has been deployed:

Open Preview

Use this to verify the app works correctly, especially for dependency updates.

github-actions Bot added a commit that referenced this pull request Mar 15, 2026
github-actions Bot added a commit that referenced this pull request Mar 15, 2026
github-actions Bot added a commit that referenced this pull request Mar 20, 2026
claude added 3 commits March 23, 2026 03:27
Comprehensive design system documentation covering color palette (light
and dark mode), typography scale, spacing/layout grid, shadows, icons,
responsive breakpoints, and CSS architecture.

Includes detailed sections on accessibility (WCAG 2.1 AA), platform
adaptations (desktop/tablet/mobile), input mode differences (keyboard/
mouse vs touch), and power user vs guided experience patterns.

https://claude.ai/code/session_01G7EiAdwAzdi7qzeYditnic
Add the new design-style-guide page to the DOC_PAGES registry in
docs/src/index.ts so it appears in programmatic navigation.

https://claude.ai/code/session_01G7EiAdwAzdi7qzeYditnic
Add the design style guide markdown content to docs-content.ts so it
appears in the in-app documentation space. Includes page tree entry,
content map, source path, and folder summary update.

https://claude.ai/code/session_01G7EiAdwAzdi7qzeYditnic
@nsheaps nsheaps force-pushed the claude/add-design-style-guide-tOY63 branch from 1158e25 to 3b820cf Compare March 23, 2026 03:29
@nsheaps nsheaps changed the title docs: add branding and design style guide docs: add design style guide with in-app visibility Mar 23, 2026
github-actions Bot added a commit that referenced this pull request Mar 23, 2026
Add a TipTap extension that auto-detects CSS color values inside inline
code and renders a small colored square swatch to the left — similar to
Chrome DevTools.

Supports hex (#rgb, #rrggbb, #rrggbbaa), rgb(), rgba(), hsl(), hsla(),
oklch(), oklab(), lch(), lab(), hwb(), color(), and all 148 CSS named
colors. Uses a ProseMirror decoration plugin so the underlying markdown
is unchanged — no special authoring syntax needed.

Swatch has a checkerboard background pattern to reveal transparency in
alpha colors, with dark mode border adaptation.

https://claude.ai/code/session_01G7EiAdwAzdi7qzeYditnic
@nsheaps nsheaps changed the title docs: add design style guide with in-app visibility feat: design style guide + inline color swatches Mar 23, 2026
github-actions Bot added a commit that referenced this pull request Mar 23, 2026
The checkerboard pattern was rendered as background-image on the same
element as the inline background-color, which meant it painted over the
color. Move the checkerboard to a ::before pseudo-element with z-index
-1 so it only shows through transparent/semi-transparent colors.

https://claude.ai/code/session_01G7EiAdwAzdi7qzeYditnic
github-actions Bot added a commit that referenced this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants