Styling & advanced options

Your blocks already follow your brand colors and fonts. For the times you want one thing to look different, such as a dark section, a bigger headline, or extra space, Studio lets you add style classes: short keywords like bg-gray-900 or text-5xl, each of which changes one thing.

Style classes are optional. Everything else in these docs works without them. Change site-wide things, like colors and fonts, in site settings rather than block by block.

Where you can add styles

WhereFieldAffects
A whole pagePage background in Page SettingsThe page's background and text color, edge to edge.
A whole blockClass (in Edit props)The block's outer area: background, spacing, borders.
Part of a blockHeadline Class, Title Class, Description ClassJust that text.
A form's button or messageSubmit Class, Success ClassThe submit button, or the success message.
Some text in the page bodySelect the text, then Span styleOnly the selected words. Enter classes, or CSS such as color: tomato; font-weight: 600;.
Any inner part of a blockUi (code editor only)See Advanced: the Ui field.

Separate several classes with spaces: uppercase italic tracking-wide.

A class you add replaces the block's built-in style of the same kind rather than adding to it. For example, text-6xl on a title replaces the title's normal size.

Class cheat sheet

To changeClassesExamples
Text sizetext-xs text-sm text-base text-lg text-xl text-2xl … text-7xltext-5xl
Boldnessfont-light font-normal font-medium font-semibold font-bold font-blackfont-black
Text styleitalic uppercase lowercase capitalize underlineuppercase italic
Letter spacingtracking-tight tracking-wide tracking-widesttracking-wide
Text colortext-white text-black text-primary text-{color}-{shade}text-gray-900, text-blue-600
Backgroundbg-white bg-black bg-primary bg-{color}-{shade}bg-gray-900, bg-amber-50
Space above and belowpy-0 py-4 py-8 py-16 py-24 py-32py-24
Space on one sidept-* (top), pb-* (bottom), mt-* / mb-* (outside)pb-0
Widthmax-w-sm max-w-md max-w-xl max-w-3xl max-w-fullmax-w-xl mx-auto
Centeringmx-auto (a block or image), text-center (text)mx-auto
Rounded cornersrounded-none rounded-lg rounded-2xl rounded-fullrounded-2xl
Bordersborder border-2 border-{color}-{shade}border border-gray-200

Colors are slate, gray, zinc, neutral, stone, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, and rose. Shades run from 50 (lightest) through 100, 200, … 900, to 950 (darkest).

Different on different screens: prefix a class with a screen size and it applies only at that width and wider. sm: is about 640 pixels and up (large phones and tablets), md: 768 and up, and lg: 1024 and up (laptops). For example, text-4xl lg:text-6xl gives a 4xl title on phones and a 6xl title on laptops.

These are Tailwind CSS classes. Any standard Tailwind utility class works. Search "Tailwind" plus what you want to do, such as "Tailwind line height", to find more.
Colors show right away. Some other classes appear only after publishing. Every color class (bg-… and text-… colors) works instantly in the editor. A class that isn't used anywhere on your site yet, such as a new text size or spacing value, might not show in the editor preview until you publish and the site rebuilds. It works on your preview and live site. If a class seems to do nothing, publish, wait for Deployment complete, and reload.

Page backgrounds

Set Page background in a page's Page Settings. There are two kinds of value:

KindExamplesBehavior
Theme colors (adapt)bg-default text-default, bg-elevated, bg-muted, bg-inverted text-invertedFollow your Appearance setting. They switch between light and dark automatically.
Fixed colors (always the same)bg-white text-gray-900, bg-gray-950 text-white, bg-amber-50Look identical in light and dark mode.

If your site uses Appearance: Light (the default), either kind works. If you switch to Dark or System, prefer theme colors, or check every fixed-color page in dark mode.

Always set a text color together with a dark background (bg-gray-950 text-white), so the text stays readable.

Common styling recipes

A dark band around one section. On the block's Class:

bg-gray-950 text-white py-24

A bigger, bolder hero title. On the Page Hero's Title Class:

text-5xl sm:text-7xl font-black tracking-tight

An all-caps eyebrow in your brand color. On Headline Class:

uppercase tracking-widest text-primary

Less space above a block. On the block's Class:

pt-0

A narrower, centered description. On Description Class:

max-w-xl mx-auto

Advanced: the Ui field

Every block also has a Ui field. It can style any inner part of a block, not just the title and description. For example, it can style a hero's button row, or the cards inside a feature grid.

Only edit Ui in the code editor. If you type into the Ui box in Edit props, Studio saves it as plain text and the block ignores it. Switch to Use code editor and write it as indented lines, as shown below.

In the code editor, add ui: to the block's props, then one line per part:

::page-hero
---
title: Welcome
ui:
  root: bg-gray-950
  title: text-white text-6xl
  description: text-gray-300
  links: gap-6
---
::

Parts you can style on the most common blocks:

BlockParts
Page Heroroot, container, wrapper, header, headline, title, description, body, footer, links
Page Sectionroot, container, wrapper, header, leading, headline, title, description, body, features, footer, links
Page CTAroot, container, wrapper, header, title, description, body, footer, links
Ctabase, label, leadingIcon, trailingIcon
Faqroot, item, header, trigger, content, body, label
Bannerroot, container, left, center, right, icon, title, actions, close

Feature Grid uses Grid Ui (the grid) and Feature Ui (each card). Testimonials uses Grid Ui and Card Ui. Write them the same way, for example featureUi: followed by root: bg-white rounded-2xl.

If you're not sure which part to target, use Class, Title Class, and Description Class first. They cover most needs.