WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node typescript hono htmx atproto

feat(lexicon): add theme and themePolicy lexicons (ATB-51) (#84)

Define two new AT Proto record types for the theming system:
- space.atbb.forum.theme (tid key) — design tokens, color scheme, CSS overrides, font URLs
- space.atbb.forum.themePolicy (literal:self) — available themes, light/dark defaults, user choice toggle

Uses knownValues for colorScheme extensibility and strongRef wrapped in themeRef named def for CID integrity.

authored by

Malpercio and committed by
GitHub
ceddbd09 334fc9fc

+130 -1
+1 -1
CLAUDE.md
··· 117 117 - **References:** Use `com.atproto.repo.strongRef` wrapped in named defs (e.g., `forumRef`, `subjectRef`). 118 118 - **Extensible fields:** Use `knownValues` (not `enum`) for strings that may grow (permissions, reaction types, mod actions). 119 119 - **Record ownership:** 120 - - Forum DID owns: `forum.forum`, `forum.category`, `forum.board`, `forum.role`, `modAction` 120 + - Forum DID owns: `forum.forum`, `forum.category`, `forum.board`, `forum.role`, `forum.theme`, `forum.themePolicy`, `modAction` 121 121 - User DID owns: `post`, `membership`, `reaction` 122 122 123 123 ## AT Protocol Conventions
+64
packages/lexicon/lexicons/space/atbb/forum/theme.yaml
··· 1 + # yaml-language-server: $schema=https://boat.kelinci.net/lexicon-document.json 2 + --- 3 + lexicon: 1 4 + id: space.atbb.forum.theme 5 + defs: 6 + main: 7 + type: record 8 + description: >- 9 + A theme definition for an atBB forum. 10 + Themes store design tokens as key-value pairs that map to CSS custom 11 + properties, plus optional CSS overrides and font URLs. 12 + Owned by the Forum DID. 13 + key: tid 14 + record: 15 + type: object 16 + required: 17 + - name 18 + - colorScheme 19 + - tokens 20 + - createdAt 21 + properties: 22 + name: 23 + type: string 24 + maxLength: 300 25 + maxGraphemes: 100 26 + description: >- 27 + Human-readable theme name (e.g., "Neobrutal Default", "Dark Mode"). 28 + colorScheme: 29 + type: string 30 + knownValues: 31 + - light 32 + - dark 33 + description: >- 34 + Which color scheme mode this theme targets. 35 + tokens: 36 + type: unknown 37 + description: >- 38 + Design token key-value pairs mapping to CSS custom properties. 39 + Keys are token names (e.g., "color-bg"), values are CSS values 40 + (e.g., "#f5f0e8"). Stored as a JSON object. 41 + cssOverrides: 42 + type: string 43 + maxLength: 100000 44 + maxGraphemes: 50000 45 + description: >- 46 + Raw CSS for structural overrides beyond token values. 47 + fontUrls: 48 + type: array 49 + description: >- 50 + HTTPS URLs for external font stylesheets 51 + (e.g., Google Fonts, self-hosted). 52 + items: 53 + type: string 54 + format: uri 55 + createdAt: 56 + type: string 57 + format: datetime 58 + description: >- 59 + Timestamp when this theme was created. 60 + updatedAt: 61 + type: string 62 + format: datetime 63 + description: >- 64 + Timestamp when this theme was last modified.
+65
packages/lexicon/lexicons/space/atbb/forum/themePolicy.yaml
··· 1 + # yaml-language-server: $schema=https://boat.kelinci.net/lexicon-document.json 2 + --- 3 + lexicon: 1 4 + id: space.atbb.forum.themePolicy 5 + defs: 6 + main: 7 + type: record 8 + description: >- 9 + Theme configuration policy for an atBB forum. 10 + Controls which themes are available to users, the defaults for 11 + light and dark mode, and whether users can choose their own theme. 12 + Separated from the main forum record to allow independent updates 13 + without invalidating strongRefs to the forum record. 14 + Owned by the Forum DID. 15 + key: literal:self 16 + record: 17 + type: object 18 + required: 19 + - availableThemes 20 + - defaultLightTheme 21 + - defaultDarkTheme 22 + - allowUserChoice 23 + properties: 24 + availableThemes: 25 + type: array 26 + description: >- 27 + Themes the admin has enabled for users. Both defaultLightTheme 28 + and defaultDarkTheme must be members of this list. 29 + items: 30 + type: ref 31 + ref: "#themeRef" 32 + defaultLightTheme: 33 + type: ref 34 + ref: "#themeRef" 35 + description: >- 36 + The default theme for light color scheme mode. 37 + defaultDarkTheme: 38 + type: ref 39 + ref: "#themeRef" 40 + description: >- 41 + The default theme for dark color scheme mode. 42 + allowUserChoice: 43 + type: boolean 44 + description: >- 45 + Whether users can select their own theme from the available list. 46 + When false, all users see the forum defaults. 47 + default: true 48 + updatedAt: 49 + type: string 50 + format: datetime 51 + description: >- 52 + Timestamp when this policy was last modified. 53 + themeRef: 54 + type: object 55 + description: >- 56 + A reference to a theme record, wrapped in a named def for semantic 57 + clarity and future extensibility. 58 + required: 59 + - theme 60 + properties: 61 + theme: 62 + type: ref 63 + ref: com.atproto.repo.strongRef 64 + description: >- 65 + Strong reference (AT-URI + CID) to a space.atbb.forum.theme record.