Reference

Style Properties

Every styled element in a Meno project gets its look from a style() call in the class attribute. You never write a raw class="..." string — instead you pass a Meno StyleObject to style(), and the matching CSS is generated at build time by the meno() integration. This reference catalogs the StyleObject shape and the CSS properties you can set inside it.

For the bigger picture of how styling works, see Styling. For pseudo-states and JS-triggered states, see Interactive Styles. To vary styles per instance from a component prop, see Component Props.

The StyleObject shape

A StyleObject has up to three responsive keys — base, tablet, and mobile. Each holds a flat object of CSS properties. Only base is required.

<div class={style({
    base: { display: "flex", gap: "12px", padding: "24px" },
    tablet: { padding: "16px" },
    mobile: { padding: "12px" }
  })}>

Inside each breakpoint object:

  • Keys are CSS property names in camelCasebackgroundColor, fontSize, borderRadius, marginTop. Never kebab-case (background-color is wrong).

  • Values are always strings — even numeric ones, like zIndex: "10" or opacity: "0.8".

You can also pass a flat object (no breakpoint keys) when you only need base styles. The two forms are equivalent:

<span class={style({ fontStyle: "italic" })}>
<span class={style({ base: { fontStyle: "italic" } })}>

Values: colors and tokens

Colors come from colors.json and are referenced with var(--name). Raw hex values are not part of the theme system — always use the variable. The names in this project include:

Variable

Role

var(--text)

Primary text color

var(--text-light)

Muted / secondary text

var(--bg)

Page background

var(--bg-light)

Raised surface background

var(--border)

Default border color

var(--primary)

Accent / brand color

var(--bg-hover)

Hover background

<div class={style({ base: {
  color: "var(--text)",
  backgroundColor: "var(--bg-light)",
  borderColor: "var(--border)"
} })}>

Because colors are variables, an element automatically follows whichever theme (dark or light) is active.

Design tokens come from variables.json and are referenced the same way, with var(--name). This project defines a font-family token:

<p class={style({ base: { fontFamily: "var(--ff)" } })}>

Everything else — lengths, keywords, shorthands — is a plain string: padding: "12px 22px", display: "flex", transition: "all 0.2s", border: "1px solid".

Property catalog

These tables list the most common properties grouped by purpose. The names are exactly what you write as object keys; the example column shows a typical value string. This is a practical catalog, not the full CSS surface — any valid CSS property works as a camelCase key.

Layout and box

Property

Example value

display

"flex", "grid", "block", "none"

position

"relative", "absolute", "sticky"

top, right, bottom, left

"0", "100%"

width, height

"100%", "380px"

minWidth, maxWidth

"200px", "1280px"

minHeight, maxHeight

"100vh"

overflow

"hidden", "auto"

aspectRatio

"16 / 9"

boxSizing

"border-box"

Flexbox

Property

Example value

flexDirection

"row", "column"

justifyContent

"center", "space-between"

alignItems

"center", "flex-start"

flexWrap

"wrap"

gap

"12px"

flexGrow, flexShrink

"1", "0"

flexBasis

"50%"

flex

"1 1 auto"

order

"2"

Grid

Property

Example value

gridTemplateColumns

"repeat(3, 1fr)"

gridTemplateRows

"auto 1fr"

gridColumn, gridRow

"span 2"

gridAutoFlow

"row", "column"

columnGap, rowGap

"24px"

placeItems

"center"

Spacing

Property

Example value

margin

"auto", "0 0 8px 0"

marginTop, marginRight, marginBottom, marginLeft

"40px"

padding

"0 80px", "12px 22px"

paddingTop, paddingRight, paddingBottom, paddingLeft

"92px"

Typography

Property

Example value

fontSize

"16px", "78px"

fontWeight

"450", "600"

fontFamily

"var(--ff)", "inherit"

lineHeight

"90%", "1.4"

letterSpacing

"-0.06em"

textAlign

"left", "center", "right"

textDecoration

"none", "underline"

textTransform

"uppercase"

fontStyle

"italic"

whiteSpace

"nowrap"

Color and background

Property

Example value

color

"var(--text)"

backgroundColor

"var(--bg-light)"

background

"none", "linear-gradient(...)"

backgroundImage

"url(/images/hero.webp)"

backgroundSize

"cover"

backgroundPosition

"center"

backgroundRepeat

"no-repeat"

objectFit

"cover", "contain"

Border and radius

Property

Example value

border

"1px solid"

borderColor

"var(--border)"

borderWidth

"1px"

borderStyle

"solid"

borderTop, borderBottom

"1px solid var(--border)"

borderRadius

"8px"

outline

"2px solid var(--primary)"

outlineOffset

"2px"

Effects and misc

Property

Example value

boxShadow

"0 4px 12px rgba(0, 0, 0, 0.1)"

opacity

"0.8"

transform

"translateY(-1px)"

transition

"all 0.2s"

cursor

"pointer"

zIndex

"1000"

visibility

"hidden"

pointerEvents

"none"

listStyle

"none"

Responsive breakpoints

base applies everywhere. Add tablet and mobile only to override specific properties at those widths — anything you omit inherits from base. The breakpoints are max-width thresholds:

Key

Applies at

base

All widths

tablet

1024px and below

mobile

540px and below

You only include the breakpoint keys you actually override. In this Section component, base sets the inner padding once and the smaller breakpoints just tighten it:

<div class={style({
    base: { padding: "0 80px", margin: "auto" },
    tablet: { padding: "0 40px" },
    mobile: { padding: "0 20px" }
  }, __props)}>

A breakpoint key you do not need can be left out entirely, or left as an empty object — both are equivalent and round-trip to the same model.

Prop-bound values (_mapping)

Inside a component, a property value can vary per instance based on a prop. Instead of a plain string, use a mapping object — { _mapping: true, prop, values } — and the runtime picks the value matching the current prop.

Field

Meaning

_mapping

Always true — marks this value as prop-bound

prop

The name of an interface prop to read

values

Map from each possible prop value to a CSS value

This Button varies its background color by a variant prop:

<Link href={link} class={style({
    base: {
      backgroundColor: {
        _mapping: true,
        prop: "variant",
        values: { primary: "var(--text)", secondary: "var(--bg)" }
      },
      borderRadius: "8px"
    }
  }, __props, { root: true })}>

A boolean prop maps on true / false keys, and a select prop maps on each of its options:

marginTop: {
  _mapping: true,
  prop: "isMarginTop",
  values: { true: "40px", false: "0" }
}

Mappings can appear anywhere a value can, in any breakpoint. The prop named must be declared in the component's resolveProps(Astro, {…}) argument — see Component Props.

The second style() argument

style() takes an optional second argument carrying editor metadata that is not part of the visual style itself:

  • interactive — an array of pseudo-state and conditional-state rules (:hover, :focus, class-toggle selectors). This is the main use of the second argument; see Interactive Styles for the full rule shape.

  • label — a friendly name shown for the element in the editor's structure tree.

<h2 class={style({
    base: { fontWeight: "500" }
  }, {
    interactive: [
      { name: "on hover", postfix: ":hover", style: { base: { opacity: "0.8" } } }
    ],
    label: "Heading"
  })}>

On a component's structure root, the second argument is __props (the resolved props, so mappings can read them) and the metadata moves to a third argument. The root always carries a root: true marker:

<div class={style({ base: { /* … */ } }, __props, { root: true, label: "Section" })}>

You rarely write these markers by hand — the editor manages root, label, and interactive for you. What matters when hand-editing is the first argument: the StyleObject of CSS properties.


For how these properties surface in the visual editor, see Styling. For pseudo-states and state-class rules, see Interactive Styles. For declaring the props that _mapping reads, see Component Props.

Building the future of digital experiences, one website at a time

Product

Resources

Comparisons

© 2026 Meno. All rights reserved.