Fitbricks design system — Astro
Content-free building blocks of the Fitbricks template, mirrored from the Framer components and from the design system of
the Next.js version: the same component names, props and Tailwind classes, so both versions render the same DOM. Components
never import src/content — sections pass data in through props. Import a component by its path
(import Button from "../design-system/components/actions/Button.astro"); there is no barrel. See them all together at
/style-guide (src/pages/style-guide.astro): public, noindex, not in the sitemap and not linked from the site.
Conventions
Section titled “Conventions”- Tokens, not raw values.
text.h2,bg-lime,text-orange,ease-spring-bounce,ease-framer,spring— never a hex or a font size typed into a component; a value used twice becomes a token. Phone is the default;mdis 810 andlg1200. - No content imports, no copy. A component takes its data through props; sections map content with
src/lib/to-ui.ts. cnonly joins class names. It does not merge Tailwind classes; where a default has to change it is a prop that takes a whole class string (Sectionpaddingandinner; cardheight;InfoCardpadding;FormsubmitClass;LoadOnScrollclassanditemClass;RichTextlistClass).- Positioning belongs to the caller (
classfor margins, grid placement, absolute positions). - State is a script, not a framework island. A component with state writes its markup in the state React renders first and
calls an
init*()function from its own<script>; the function lives inscripts/(the header’s insrc/components/site/), takes no arguments and finds its elements bydata-*attributes. The HTML edition is generated from this version and calls everyinit*()once.setHamburger(arguments) is exported for the header. - Hovers run in CSS with the spring curves of
theme.css(group-hover,duration-400 ease-spring-bounce,ease-framer), as in Next.js. Motion (motionpackage, from the scripts, throughutils/play.ts, which honours reduced motion asMotionConfig reducedMotion="user") runs the header’s colours, logo and menu height, the hamburger’s lines, the hero’s appear effects and the quote slider’s photos. - Parts React mounts only in one state (the phone menu) are in the markup,
hidden. Lists that React renders as children are function slots called per item (Ticker,Carousel,LoadOnScroll:{(i: number) => <Card item={items[i]} />}). - One component per file. Constants a component shares live in a sibling
.ts(layout/section.ts,cards/surface.ts,cards/card-action.ts,actions/button.ts,brand/eyebrow.ts,navigation/nav-button.ts,forms/field.ts,forms/form-state.ts,forms/submit-state.ts,icons/paths.ts,patterns/inline.ts); the shapes of the data the components take are intypes.ts. PropsclassName/submitClassName/itemClassName/listClassNameof the Next.js version areclass/submitClass/itemClass/listClasshere; text children are alabelprop (Button,TextLink,NavButton,Eyebrow,CardAction,SectionText); the split title section’sactionis a named slot. - Ids: components that React gives a
useId()(Accordion,RadioGroup) take anidfrom the caller. - Framer first. A deliberate refinement is written in the component’s leading comment and in the spec’s Deviations.
Tokens
Section titled “Tokens”| File | Holds |
|---|---|
theme.css |
Colours (black, white, lime, orange, danger, focus, spinner), breakpoints, the easings ease-framer, ease-zoom, ease-spring / -bounce (Framer’s springs as linear() curves), the ticker keyframes, the Manrope fallback — the Next.js file plus the fallback @font-face; src/styles/global.css imports it after Tailwind. The font is a local variable Manrope (astro.config.mjs → fonts) |
tokens/text.ts |
The 13 text styles, per breakpoint |
tokens/motion.ts |
Motion options: spring, springBounce, tween, quoteTween, the hero’s appear springs and delays, the scroll appear, tickerSpeed |
Components
Section titled “Components”| Group | Component | Use |
|---|---|---|
| actions | Button, TextLink |
Framer’s Primary buttons (orange, black, white, simple) and the “Read more” link |
| brand | Logo, Eyebrow |
The wordmark (light, dark, black) and the label pills |
| icons | Icon, LevelIcon |
Phosphor icons and the dumbbell before a program’s level |
| layout | Section, TitleBlock, TitleSection, SectionText |
Page bands and Framer’s title blocks |
| cards | ClubCard, ProgramCard, FeatureCard, InfoCard, AppCard, TestimonialCard, PostCard, InstagramTile, TrainerCard, ProgramLink, PricingCard, CardAction |
Framer’s cards (hovers in CSS) |
| data | CheckList, StoreBadges |
The lime-tick list and the store badges |
| media | FillImage, YouTubeEmbed |
Images that fill their box; the click-to-play YouTube embed (scripts/youtube.ts) |
| motion | Appear, TextAppear |
Framer’s appear effects on load and on scroll (scripts/appear.ts) |
| navigation | NavButton, Hamburger, CategoryLink |
Menu links and chips, the menu button (scripts/hamburger.ts), the category links |
| patterns | Ticker, Carousel, QuoteSlider, Accordion, LoadOnScroll, LoadSpinner, RichText, InlineText |
The testimonials ticker (CSS) and carousel, the hero quotes, the FAQ rows, Framer’s load on scroll (every item in the HTML), CMS rich text |
| forms | Form, FormField, FieldControl, RadioGroup, SubmitButton |
The three forms (src/lib/forms/README.md) |
| utils | CurrentYear |
The copyright year, updated by a script |