Skip to content

Attributes

View Markdownllms.txt

Attributes go in braces, as in {size=5xl color=accent}. This page lists every attribute the compiler accepts and the valid values for each one. For the brace syntax itself (.style, #id, quotes, position on the line), see Syntax.

An unknown attribute is an error (F209), and so is an invalid value (F301); the messages suggest the closest name or value.

They work on any block, on the slide separator (--- {…}), on text spans ([text]{…}) and on images.

AttributeAccepted valuesExampleNotes
colorColorcolor=accentText color. Also applies to icons.
bgColor or gradient color..colorbg=ink..violetBackground. The gradient is linear and diagonal (135°).
imagehttps://…, http://…, data:image/… or asset:<id>image=asset:<id>Background image, covering the area and centered.
fontFont token: body, display, mono or a @fontfont=displayTypeface.
sizeSize scale or pixels from 8 to 400size=5xl, size=120Text size; on icons, the icon size.
weightWeight by name or 100 to 900, in steps of 100weight=bold, weight=600Font weight.
italicBooleanitalic, italic=falseItalic.
uppercaseBooleanuppercaseAll caps.
alignleft, center, rightalign=centerHorizontal alignment, in any layout.
valigntop, center (or middle), bottomvalign=bottomVertical alignment, in any layout.
padOne or two spacing valuespad=lg, pad="sm xl"Inner spacing. With two values: vertical and horizontal.
gapSpacinggap=xlSpace between the children of a block.
radiusRadius or pixels from 0 to 9999radius=lgRounded corners.
borderWidth (0 to 40 px) and/or color, in any orderborder, border="2 coral"With no value: 3 px in the theme’s line color.
shadowsm, md, lg, noneshadow, shadow=lgWith no value, it is md.
wLength or autow=50%, w=480Width.
hLength or autoh=fullHeight.
xLengthx=120Absolute horizontal position (distance from the left).
yLengthy=80Absolute vertical position (distance from the top). With only one of x/y, the other is 0.
opacityNumber from 0 to 1 or percentage from 0% to 100%opacity=0.6, opacity=60%Transparency of the whole block.
leadingtight, normal, loose or a number from 0.6 to 3leading=tightLine height. See line height.
trackingtight, normal, wide or a number from -0.2 to 1 (in em)tracking=0.1Letter spacing.
stepWhole number from 1 to 99step=2Step at which the block or span appears. See Reveal.

Boolean attributes accept true, yes or sim to turn on and false, no or não to turn off. Writing just the name ({italic}) turns the attribute on.

--- {bg=paper..surface}
::: columns {gap=xl}
::: box {bg=accent color=white radius=xl pad="md lg" shadow=lg}
## Warm card
`accent` background, `xl` corners
:::
::: box {border="4 blue" radius=md pad=lg}
## Blue border {color=blue}
`border="4 blue"` {italic}
:::
::: box {bg=ink..violet color=white radius=full pad="lg xl" align=center}
## Gradient
`bg=ink..violet` {opacity=0.8}
:::
:::

Besides the style attributes, some blocks accept attributes of their own. Using them anywhere else is an error (F209). In a @style, all of them are accepted, and they only take effect when the style is applied to the right block.

AttributeWhereValuesDefaultExample
fitBlock imagecontain (whole image) or cover (fills and crops)contain![Photo](https://…){fit=cover}
widthscolumnsPositive numbers separated by spaces, one per columnEqual columns::: columns {widths="2 1"}
colsgridWhole number from 1 to 12Number of children, from 1 to 3::: grid {cols=4}
wraprowBoolean: wraps the items onto more than one lineOff::: row {wrap}
typechartbar, line, area, pie, donutbar::: chart {type=line}
legendchartBooleanOn with more than one series or for pie/donut{legend=false}
stackedchartBoolean: stacks the seriesOff{stacked}
valueschartBoolean: shows the values on the chartOff{values}
colorschartList of colors separated by spaces, one per seriesTheme palette{colors="accent blue"}
cover--- separatorBoolean: the slide is a cover and has no header or footerOn for the first slide only--- {cover}
header--- separatoron or off: shows or hides the header on this slideOn, except on the cover--- {header=off}
footer--- separatoron or off: shows or hides the footer on this slideOn, except on the cover--- {footer=on}

In widths, the proportions are relative: "2 1" gives two parts to the first column and one to the second. If the number of values does not match the number of columns, the compiler warns (F302).

The default chart palette uses, in order, accent, blue, green, yellow, violet and coral.

Used by size. Pixels from 8 to 400 also work.

NamePixels
xs20
sm26
md32
lg40
xl52
2xl64
3xl88
4xl116
5xl150
6xl200
7xl260
::: row {gap=lg valign=bottom}
md {size=md}
xl {size=xl}
3xl {size=3xl}
5xl {size=5xl}
7xl {size=7xl}
:::

Used by pad, gap and :: spacer. Pixels from 0 to 600 also work.

NamePixels
none0
xs8
sm16
md32
lg48
xl72
2xl112
3xl160

Used by radius. Pixels from 0 to 9999 also work.

NamePixels
none0
sm8
md16
lg28
xl44
full9999 (pill or circle shape)

Used by weight. Numbers from 100 to 900, in steps of 100, also work.

NameWeight
thin100
light300
regular400
medium500
semibold600
bold700
extrabold800
black900

A weight only shows up if the font has it. Fonts declared with @font load the weights listed in the definition.

AttributeKeywordValueNumeric range
leadingtight1.050.6 to 3 (multiplies the font size)
leadingnormal1.35
leadingloose1.7
trackingtight-0.02 em-0.2 to 1 (in em)
trackingnormal0
trackingwide0.08 em

Used by w, h, x and y.

FormExampleMeaning
Pixels480 or 480pxFrom -4000 to 4000. The px suffix is optional.
Percentage50%From 0% to 100% of the available space.
fullw=fullSame as 100%.
autoh=autoAutomatic size. Only for w and h.

The slide is 1920×1080 pixels (or 1440×1080 with @aspect 4:3), and every length uses that size, whatever the screen.

Used by color, bg, border and colors.

FormExampleMeaning
Theme tokenaccent, muted, coralColor defined by the theme or by @color.
Hexadecimal#f60, #ff6600, #ff660080#rgb, #rgba, #rrggbb or #rrggbbaa.
Opacityaccent/40, #000000/20Color with an opacity from 0 to 100 (%), after the slash.
Gradientink..violet, accent/80..blueTwo colors separated by ... Only in bg.

Tokens available in every theme: bg, text, muted, accent, surface, line, coral, blue, green, yellow, violet, white, black, ink, paper and transparent. The values for each theme are in Built-in themes.

Every color token also works as a style: {.coral} is the same as {color=coral}.

::: grid {cols=4 gap=md}
::: box {bg=accent pad=md radius=md}
`accent`
:::
::: box {bg=accent/40 pad=md radius=md}
`accent/40`
:::
::: box {bg=#2f6fdb color=white pad=md radius=md}
`#2f6fdb`
:::
::: box {bg=coral..violet color=white pad=md radius=md}
`coral..violet`
:::
:::