Style manual#
Start with style and animation libraries: learn bundled libraries, sources and imports, then explore entries, parameters and composition. One .lay file is enough to begin.
Keep dimensions, anchors, data and placement in .lay, with repeated appearance in a theme. Follow these chapters and use the property reference for details.
This manual describes current source. New offline style libraries and diagnostics require an engine build containing those changes; release notes describe published packages.
Learning path#
- Getting started and libraries
- Selectors, variables and cascade
- Appearance properties and units
- Shadows and effects
- Compatibility and troubleshooting
Complete projects#
Combine libraries and motion in three worked projects: styled cards, artistic poster, and the recovered complex dashboard. Each includes editable source, themes and real playback.
Complete runnable example#
page = canvas(size=(132mm,65mm), stylesheet="style-theme.lcss", background="#f6f7fb")card_size = (30mm,22mm)gap = 9mmlibrary = page.add(rect(size=card_size,class="bg-primary rounded shadow"), target=page.top_left,offset=(12mm,12mm))custom = page.add(rect(size=card_size,class="bg-primary rounded shadow custom"), target=library.top_right,offset=(gap,0mm))props = page.add(rect(size=card_size,class="card ocean"), target=custom.top_right,offset=(gap,0mm))for card,label in [(library,"Library shadow"),(custom,"Blur: 2 mm"),(props,"Open Props")] { page.add(text(label,class="caption"),target=card.bottom_left,offset=(0mm,gap))}@import "@laymesh/bootstrap.css";@import "@laymesh/open-props.css";:root { --ink: #243447; font-size: 16px; }.card { padding: 1mm; border-radius: var(--radius-3); }.ocean { background: var(--gradient-7); box-shadow: var(--shadow-3); }.caption { font-size: 3mm; color: var(--ink); }.shadow.custom { box-shadow-blur: 2mm !important; }Preview
Dependencies
examples/manual/style-project.layexamples/manual/style-theme.lcss
The first card sets its page margin relative to page.top_left. Subsequent cards follow top_right, and each label follows its card's bottom_left. card_size and gap control dimensions and spacing: change width from 30mm to 26mm and the following cards and labels move with their anchors. Themes save appearance, loops remove repetition, and anchors save layout relationships. See placement and loops/functions.
Common questions#
Explicit .lay parameters override LCSS, including important declarations. Omit the matching object parameter when the theme should control it; see cascade. Change only blur to 2mm with partial overrides.
