LingEx
All module documentation

lingex-theme

LingEx Theme

Source details
Source revision
06286577003b2b53675604148c43ee1838855c0f
Source SHA-256
49cb8deec955f10224c73277b701e91139418c9a114875702eef14af02df4caa

LingEx Theme

lingex-theme is the canonical shared theme system for LingEx web products.

It owns:

  • semantic design tokens and reusable visual variables;
  • shared CSS foundations and shell/game presentation assets;
  • reusable theme packaging/publish contracts;
  • the Theme-owned lingex_themes catalogue and its module migrations/seeders.

Canonical branding source/master assets remain owned by lingex-branding; product-specific page styles remain with their product unless deliberately promoted into a shared Theme contract.

Dependency boundary

Brand guidance is upstream of Theme. Web Runtime, Admin Console, Content Presentation and product modules consume Theme's published assets/contracts.

Theme does not own routing, authentication, authorization, publication policy, editorial content, product business logic or top-level rendering.

Theme owns its schema/data semantics for lingex_themes. The approved target database connection/configuration/access provider is lingex-core; consuming the shared Core service does not move Theme's table ownership into Core.

The Theme module registers the table's versioned schema metadata with Core and references its frozen Persistence migration. Theme also registers the read-only service lingex.theme.catalogue at contract version 1.0.0, with capabilities theme-catalogue.active-options and theme-catalogue.key-selectable. It returns active theme keys, labels and descriptions and validates whether an exact key is active. Theme resolves its connection through Core's lingex.core.database-access service and Persistence's database.connection capability. Consumers receive neither PDO nor mutation methods.

Published assets

Canonical shared runtime assets include:

  • public/shared/assets/top-bar.css
  • public/shared/assets/site.css
  • public/shared/assets/game-shell.css
  • public/shared/assets/card-game/card-game.css

The Theme package declares the page-shell styles it owns in src/php/web-assets.php. Web Runtime consumes those stable declarations and owns dependency ordering and HTML emission.

The card-game stylesheet provides reusable game-agnostic card/table presentation. Web Runtime owns the matching browser interaction implementation; game modules own game-specific composition and state. It is scoped to game consumers and is not included in every page shell automatically.

The fixed-window shell contract is shared with Web Runtime: Web Runtime owns the opt-in layout state and markup, while Theme owns the bar-height token, viewport geometry, safe-area, overflow and responsive CSS.

Verification

bash scripts/verify-repo-shape.sh
bash scripts/check-architecture.sh
php tests/test-web-assets.php
php tests/test-persistent-resources.php
php tests/test-theme-catalogue-service.php
php tests/verify-fixed-window-css.php
git diff --check