Foundry architecture
Understand the framework layers and the responsibilities assigned to each one.
- Owner
- Foundry product documentation
- Source
docs/docs/ARCHITECTURE.md- Ref
v0.1.4- Policy
- release-bound
Component pins for v0.2.4
| Component | Role | Version |
|---|---|---|
| core | runtime | v0.1.20 |
| theme-shield | theme | v0.1.15 |
| starter | reference | v0.1.3 |
| docs | reference | v0.1.4 |
| distribution | tooling | v0.3.2 |
| restricted-component-1 | consumer-reference | v0.1.10 |
| restricted-component-2 | consumer-reference | v1.1.21 |
LikeStyle Foundry is split into composable modules so block logic, visual design, and site content evolve independently.
Repositories
likestyle-foundry-core: Block renderer, block partials, shared class tokens, schemas.likestyle-foundry-theme-shield: Default visual system (theme CSS, header/footer, base layout).likestyle-foundry-starter: Runnable starter site pinned to known module versions.likestyle-foundry-distribution: Release bundles, compatibility manifests, verification tooling.likestyle-foundry-docs: Documentation, contracts, and migration guidance.
Compatibility Layer
Foundry compatibility is managed as a stack, not as a collection of unrelated repo tags.
likestyle-foundry-distribution owns:
- stable and preview bundle manifests
- the expected compatible repo tag set
- verification commands that must pass before a shared release is considered complete
- site consumption guidance for pinned or vendored installs
This lets the framework continue evolving while production sites stay pinned to known-good bundles.
Rendering Pipeline
- A page declares
sectionsin front matter. render-sections.htmlreads each section and resolvesblockviadata/foundry/block-registry.yaml.- The matching block partial receives:
.page(current page context).section(block payload:content,design,id, optionaldata)
- If
datais specified, Foundry merges referencedsite.Datapayload before render.
This gives a strict content contract with predictable rendering behavior.
Canonical Block Artifacts
Foundry now keeps block implementation standards in two core artifacts:
layouts/partials/blocks/_template.html- Canonical implementation template for all new blocks
- Defines standard context extraction, section wrapper shape, and BEM patterns
data/foundry/block-options.yaml- Canonical registry of supported
designfields and variants per block - Intended as documentation plus a future validation input
- Canonical registry of supported
Together these reduce implementation drift and keep block contracts consistent across core, themes, starter, and demo sites.
Theme-Provided Components
likestyle-foundry-theme-shield now provides reusable layout primitives by default:
layouts/_default/baseof.htmllayouts/partials/header/site-header.htmllayouts/partials/footer/site-footer.htmllayouts/partials/head/theme-css.html- Hooks for extension:
layouts/partials/head-start.htmllayouts/partials/head-end.htmllayouts/partials/body-start.htmllayouts/partials/body-end.html
Header behavior
- Reads
site.Menus.main - Supports nested menu children
- Mobile menu toggle + submenu toggles
- Optional CTA from
site.Params.header.cta - Optional logo from
site.Params.logo(fallback to title text)
Footer behavior
- Reads
site.Menus.footer, fallback tosite.Menus.main - Supports grouped link columns (children)
- Optional social links from
site.Params.footer.social - Optional tagline from
site.Params.footer.tagline - Includes current year copyright
CSS Architecture
The CSS model is layered:
- Theme tokens (
--foundry-*) define brand colors, surfaces, typography, radii, shadows, and motion. - Theme component rules style common blocks, header/footer, forms, cards, buttons, and utility mappings.
- Site overrides should be minimal and brand-specific only.
Goal: consume the theme defaults first, then add only site-specific deltas.
Tailwind + Utility Integration
Foundry blocks use class contracts from data/foundry/classes.yaml (button/card/chip/panel tokens).
The theme maps common utility patterns to tokenized design values so you can keep content clean and avoid massive per-site CSS files.
Customizing Header and Footer
Recommended override strategy:
- Start with theme defaults.
- Change menus and params first.
- Override partials locally only when structure must change.
Common config knobs:
site.Titlesite.Params.logosite.Params.header.ctasite.Params.footer.taglinesite.Params.footer.socialsite.Menus.main,site.Menus.footer
Feature Flags Reference
Feature flags are read from site.Params.foundry.features (case-insensitive keys):
newNav: Enables modern nav behavior (submenu toggles, mobile interactions).experimentalHero: Enables hero behavior gated for rollout.uiCards: Enables card/panel-heavy styling across compatible blocks.animations: Enables motion hooks/class behavior.
Theme base layout also emits body classes from enabled flags:
foundry-feature-<flag>for each enabled flagfoundry-motion-enabledorfoundry-motion-disabled
This supports gradual rollout and per-site compatibility.
Shared Runtime Utilities
Foundry runtime behavior should stay centralized when multiple sites need the same interaction pattern. Current examples:
- Motion engines in
foundry-motion.js - Shared header measurement that publishes
--foundry-scroll-offset - Table of contents state management for active items, completed items, mobile compact mode, and progress rails
Themes should style these behaviors through tokens and class contracts, while sites only own placement and layout wrappers when necessary.
Versioning and Stability
Pin module versions in each site (go.mod) to prevent accidental design/runtime
changes.
Use controlled bundle upgrades and validate against docs, starter, and preview
environments before production rollout.