Open Props: variables, parameters and complete catalog#
Comparison gallery: original recipes, actual exports and reference differences
What it is and where it comes from#
Open Props is an open-source design-variable library. LayMesh pins original 1.7.23 CSS under MIT. It provides coordinated colors, gradients, corners, shadows, typography and motion values, consumed by style properties.
Your first variables#
page=canvas(size=(100mm,65mm),stylesheet="@laymesh/open-props.css",background="#f6f7fb")style { .card { background:var(--gradient-7);border-radius:var(--radius-3);box-shadow:var(--shadow-3); } .label { color:var(--blue-9);font-size:4mm; }}card=page.add(rect(size=(40mm,25mm),class="card"),anchor=center,target=page.center)page.add(text("Open Props: variables",class="label"),anchor=top_center,target=card.bottom_center,offset=(0mm,8mm))The .card declaration applies variables to properties; class="card" applies that appearance. Importing the file alone does not automatically paint every object.
Where variables belong#
| Variable family | Consumer property | Meaning |
|---|---|---|
--blue-*, --gray-* |
color, background-color, border-color | Coordinated color scales |
--gradient-* |
background | Complete gradient recipe |
--radius-* |
border-radius | Corner scale |
--shadow-*, --inner-shadow-* |
box-shadow | Layered outer or inner shadows |
--size-* |
padding and supported lengths | Spacing; Lay still sets dimensions and placement |
| Font size, weight, line-height variables | Corresponding properties | Choose a variable matching the property |
--ease-*, --duration-* |
animation-timing-function, animation-duration | Easing or duration |
--animation-* |
animation | Open Props animation recipes and keyframes |
Relative lengths use root font size, canvas size and layout_dpi. Variable types are not interchangeable; catalog entries identify their consumer properties.
Open Props also includes motion#
page=canvas(size=(100mm,65mm),stylesheet="@laymesh/open-props.css",background="#f6f7fb")style { .card {background:var(--gradient-7);border-radius:var(--radius-3);box-shadow:var(--shadow-2);} .motion {animation:var(--animation-fade-in);animation-duration:800ms;animation-fill-mode:both;}}card=page.add(rect(size=(40mm,25mm),class="card"),anchor=center,target=page.center)s=page.step(name="Open Props keyframes",start="after-previous",hold=1s)s.animate(card,class="motion")This imports only Open Props and uses --animation-fade-in, rather than the Animate.css animate__fadeIn class. They are different sets of definitions.
Complete searchable catalog#
The catalog lists every declared variable and keyframe, including helpers and currently unsupported consumers. Each usable entry has a complete recipe; related entries share one preview. Font families ship no font files, and unsupported consumers or expressions explain their limitations.
Catalog recipes give rect a low-specificity color and border so corners, opacity and motion are visible. Class declarations and variable consumers still cascade normally.
Adjust a property using project units
Edit the full source too. Selecting an entry loads its original recipe; Restore clears edits. Seek animation time under More → Playback controls.
page=canvas(size=(100mm,100mm),stylesheet="@laymesh/open-props.css",background="#f6f7fb")style {rect {background-color:#0d6efd;border:1px solid #20332f}text {background-color:#e9ecef;color:#212529;border:1px solid #adb5bd}.sample { background: var(--gradient-7); }}item=page.add(rect(size=(40mm,25mm),class="sample"),anchor=center,target=page.center)Preview
Dependencies
examples/libraries/catalog-open-props.lay
All 30 gradient recipes#
The original --gradient-1 through --gradient-30 recipes are accepted without rewriting or splitting objects. The library’s @supports branch enables OKLab by default. To compare legacy interpolation, set :root { --gradient-space: in srgb; }. This changes the interpolation space without changing the recipes.
# Original Open Props recipes; one object per recipe.page=canvas(size=(170mm,180mm),stylesheet="@laymesh/open-props.css",background="#ffffff")style { .g1 { background:var(--gradient-1);border:0;border-radius:1mm; } .g2 { background:var(--gradient-2);border:0;border-radius:1mm; } .g3 { background:var(--gradient-3);border:0;border-radius:1mm; } .g4 { background:var(--gradient-4);border:0;border-radius:1mm; } .g5 { background:var(--gradient-5);border:0;border-radius:1mm; } .g6 { background:var(--gradient-6);border:0;border-radius:1mm; } .g7 { background:var(--gradient-7);border:0;border-radius:1mm; } .g8 { background:var(--gradient-8);border:0;border-radius:1mm; } .g9 { background:var(--gradient-9);border:0;border-radius:1mm; } .g10 { background:var(--gradient-10);border:0;border-radius:1mm; } .g11 { background:var(--gradient-11);border:0;border-radius:1mm; } .g12 { background:var(--gradient-12);border:0;border-radius:1mm; } .g13 { background:var(--gradient-13);border:0;border-radius:1mm; } .g14 { background:var(--gradient-14);border:0;border-radius:1mm; } .g15 { background:var(--gradient-15);border:0;border-radius:1mm; } .g16 { background:var(--gradient-16);border:0;border-radius:1mm; } .g17 { background:var(--gradient-17);border:0;border-radius:1mm; } .g18 { background:var(--gradient-18);border:0;border-radius:1mm; } .g19 { background:var(--gradient-19);border:0;border-radius:1mm; } .g20 { background:var(--gradient-20);border:0;border-radius:1mm; } .g21 { background:var(--gradient-21);border:0;border-radius:1mm; } .g22 { background:var(--gradient-22);border:0;border-radius:1mm; } .g23 { background:var(--gradient-23);border:0;border-radius:1mm; } .g24 { background:var(--gradient-24);border:0;border-radius:1mm; } .g25 { background:var(--gradient-25);border:0;border-radius:1mm; } .g26 { background:var(--gradient-26);border:0;border-radius:1mm; } .g27 { background:var(--gradient-27);border:0;border-radius:1mm; } .g28 { background:var(--gradient-28);border:0;border-radius:1mm; } .g29 { background:var(--gradient-29);border:0;border-radius:1mm; } .g30 { background:var(--gradient-30);border:0;border-radius:1mm; }}for row in range(6) { for col in range(5) { i=row*5+col+1 page.add(rect(size=(30mm,21mm),class=f"g{i}"),offset=(5mm+col*33mm,5mm+row*29mm)) page.add(text(f"{i}",font_family="DejaVu Sans",font_size=7pt,color="#334155"),offset=(6mm+col*33mm,27mm+row*29mm)) }}