Skip to content

Foundry custom CSS

Foundry injects the CSS you save in Foundry → Settings → Advanced → Custom CSS on every published page for your domain. This page is the styling contract: what you can change, which selectors stay stable, and how to have an AI assistant write the CSS for you.

Open Cursor, Claude Code, ChatGPT, or Codex and paste:

Write custom CSS for my Zerply Foundry site.
Follow this spec exactly:
https://zerply.ai/docs/foundry-custom-css/
Brand notes:
- Site to match:
- Colors:
- Fonts:
- Other notes:
Output only CSS I can paste into Foundry → Settings → Advanced → Custom CSS.
Prefer CSS variables, then [data-foundry-*] selectors. Do not target Tailwind class names.

Fill in the brand notes (a homepage URL is enough if you have one). Paste the CSS it returns into Foundry settings and save. Pages revalidate after save.

Or install the Foundry CSS skill so the assistant already knows the contract:

Terminal window
mkdir -p ~/.cursor/skills/foundry-css
curl -fsSL https://zerply.ai/.well-known/agent-skills/foundry-css/SKILL.md \
-o ~/.cursor/skills/foundry-css/SKILL.md

Claude Code: use ~/.claude/skills/foundry-css/SKILL.md. Codex-style layouts: ~/.agents/skills/foundry-css/SKILL.md.

  • Your stylesheet is injected after Foundry’s defaults, so a rule with the same specificity as a default rule wins.
  • CSS only. No JavaScript, HTML, or <link> tags.
  • @import and @font-face are allowed. Put @import on the first line.
  • Do not target Tailwind class names (px-8, text-3xl, bg-card). Those can change. Use CSS variables and [data-foundry-*] attributes.
  • Start with variables. Reach for element selectors only when a variable is not enough.
  • !important is almost never required. Prefer variables, then [data-foundry-*]. A few values (reading-progress width, TOC highlight) are still set inline because they change at runtime.

Root of every page:

<html data-color-scheme="light|dark">
...
<div data-foundry-tenant>
<header data-foundry-region="header">...</header>
<main data-foundry-region="main">
<div data-foundry-page="hub|landing|blog-index|blog-all|blog-post|authors|author">
...
</div>
</main>
<footer data-foundry-region="footer">...</footer>
</div>
</html>

Override these on [data-foundry-tenant]. They already switch with light and dark mode.

VariableUsed for
--backgroundPage surface
--foregroundBody text
--cardCards, header default
--card-foregroundText on cards
--mutedSubtle bands (features grid, hub explore)
--muted-foregroundSecondary text
--borderDividers and card edges
--inputForm field borders
--brand-colorLinks, accents, text on light surfaces
--brand-fillSolid buttons and CTA fills with white text

--brand-color and --brand-fill are derived from the brand color in Foundry settings so they stay readable on light and dark surfaces. Override them only if you need a specific hex.

Dark-mode overrides need both attributes:

[data-color-scheme="dark"] [data-foundry-tenant] {
--background: #0b0b0c;
--foreground: #f5f5f4;
}

These default to Foundry’s built-in look. Changing them is the fastest way to restyle chrome, hero, and CTA bands.

VariableDefaultUsed for
--foundry-font-sansArial, Helvetica, sans-serifAll Foundry UI text
--foundry-header-bgvar(--card)Sticky header
--foundry-header-bordervar(--border)Header bottom border
--foundry-footer-bg#111827 in light, var(--background) in darkFooter surface
--foundry-footer-fg#d1d5db / muted in darkFooter body text
--foundry-footer-muted#9ca3af / muted in darkFooter links, description, copyright
--foundry-footer-heading#ffffff / foreground in darkFooter headings and site name
--foundry-footer-border#1f2937 / border in darkFooter bar divider
--foundry-footer-logo-filterbrightness(0) invert(1) in light, none in darkFooter logo treatment
--foundry-hero-bgslate gradientLanding hero background
--foundry-hero-fg#ffffffLanding hero text
--foundry-hero-cta-bgvar(--brand-fill)Hero button
--foundry-hero-cta-fg#ffffffHero button text
--foundry-cta-band-bgvar(--brand-fill)Landing CTA section
--foundry-cta-band-fg#ffffffCTA section text
--foundry-cta-band-button-bg#ffffffCTA section button
--foundry-cta-band-button-fgvar(--brand-color)CTA section button text

[data-foundry-page] on the main content wrapper:

ValueURLWhat it is
hub/{base_path}Site home under Foundry
landing/{base_path}/{slug}Landing page
blog-index/{base_path}/blogBlog home
blog-all/{base_path}/blog/allAll articles + filters
blog-post/{base_path}/blog/{slug}Single article
authors/{base_path}/blog/authorsAuthor index
author/{base_path}/blog/authors/{slug}Author profile

Example: hide landing-page cards on the hub, keep articles.

[data-foundry-page="hub"] [data-foundry-section="pages"] {
display: none;
}
data-foundry-partElement
innerMax-width row
brandLogo / site name link
logoLogo image
site-nameText fallback when there is no logo
navDesktop links
linkEach nav link (desktop and mobile)
ctaHeader button
searchBlog search control
search-formExpanded search field
menu-buttonMobile menu toggle
menuMobile drawer
data-foundry-partElement
innerLink columns
brandLogo, description, socials
logoFooter logo (inverted to white in light theme only)
site-nameText fallback
descriptionSite description
socialSocial icon row
link-groupA column of links
headingColumn title
linkFooter link
barBottom bar
copyrightCopyright line
themeLight / dark / auto control (only when color theme is Auto)
credit“Powered by Zerply”

Light theme keeps a dark footer and inverts the logo so a typical dark-on-light mark stays visible. Dark theme uses the page background and shows the logo as uploaded. To force either treatment:

[data-foundry-tenant] {
--foundry-footer-logo-filter: none;
}

To lighten the footer in light theme:

[data-foundry-region="footer"] {
--foundry-footer-bg: #f4f4f5;
--foundry-footer-fg: #18181b;
--foundry-footer-muted: #52525b;
--foundry-footer-heading: #18181b;
--foundry-footer-border: #e4e4e7;
--foundry-footer-logo-filter: none;
}

Shared data-foundry-section values on listing pages:

SectionWhere
introHub title and description
latest-articlesHub and blog index article grids
pagesHub landing-page grid
emptyEmpty hub state
featuredBlog index hero post
categoryBlog index category block (data-foundry-category="{slug}")

Other hooks:

SelectorElement
[data-foundry-part="recommended"]Blog index “Recommended” column
[data-foundry-part="filters"]All-articles category chips
[data-foundry-part="search"]Author search
[data-foundry-part="pagination"]Page numbers
[data-foundry-part="breadcrumbs"]Breadcrumb row
[data-foundry-part="profile"]Author header on the author page
[data-foundry-card="blog"]Article card
[data-foundry-card="landing"]Landing-page card
[data-foundry-card="author"]Author card

Each block is <section data-foundry-section="{type}">. Inner pieces use data-foundry-part.

inner, heading, subheading, cta

[data-foundry-tenant] {
--foundry-hero-bg: #0f172a;
}
[data-foundry-section="hero"] [data-foundry-part="heading"] {
font-size: 3.5rem;
}

body (markdown/HTML)

inner, item, icon, title, description

inner, heading, item (<details>), title (<summary>), description

inner, heading, cta

[data-foundry-tenant] {
--foundry-cta-band-bg: #111827;
--foundry-cta-band-button-bg: var(--brand-fill);
--foundry-cta-band-button-fg: #ffffff;
}

inner, heading, item, quote-mark, quote, rating, author, avatar, name, role

inner, media, image, copy, heading, description, cta

Also data-foundry-image-position="left" or "right".

inner, heading, item, value, label

inner, heading, item, photo, name, role, bio

inner, heading, subheading, details, address, phone, email, label, map

inner, heading, subheading, form, field, label, input, submit

inner, heading, logos, logo

inner, heading, item, name, price, period, features, cta

Featured plan: [data-foundry-featured="true"].

[data-foundry-section="pricing"] [data-foundry-featured="true"] {
background: var(--brand-fill);
color: #fff;
}

Blog post — [data-foundry-page="blog-post"]

Section titled “Blog post — [data-foundry-page="blog-post"]”
data-foundry-partElement
progressReading progress bar
headingArticle title
bylineAuthor, dates, read time
coverFeatured image
tocTable of contents (mobile card and desktop sidebar)
bodyArticle HTML (.prose)
table-wrapScroll container around markdown tables
author-card“Written by” block
sidebarDesktop TOC + sidebar CTA
sidebar-ctaMobile sidebar CTA
relatedRelated articles
bottom-ctaBottom CTA

Article HTML is normal markdown output: h2h6, p, a, img, blockquote, lists, .iframe-embed for video, and [data-foundry-part="table-wrap"] around tables.

Blog CTAs from the CTA library:

SelectorPlacement
[data-foundry-cta="inline"]Inside the article
[data-foundry-cta="sidebar"]Sidebar
[data-foundry-cta="bottom"]Below the article
[data-foundry-cta] [data-foundry-part="card"]The CTA card itself

Load a font and set the typeface:

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");
[data-foundry-tenant] {
--foundry-font-sans: "Inter", sans-serif;
}

Warm page surface, keep Foundry’s brand buttons:

[data-foundry-tenant] {
--background: #fffaf5;
--card: #ffffff;
--muted: #fff1e6;
--border: #fed7aa;
}

Match a serif article column:

[data-foundry-page="blog-post"] [data-foundry-part="body"] {
font-family: Georgia, "Times New Roman", serif;
}
[data-foundry-page="blog-post"] [data-foundry-part="heading"] {
letter-spacing: -0.03em;
}

Rounder header button:

[data-foundry-region="header"] [data-foundry-part="cta"] {
border-radius: 9999px;
padding-inline: 1.25rem;
}
  • Custom CSS cannot add markup or change which sections exist. Edit the page in Foundry for that.
  • Contact forms still submit through Foundry. You can style fields; you cannot change the POST behavior.
  • Images in CSS must be absolute https:// URLs you already host.
  • After you save, published pages refresh. If a page looks stale, wait a few seconds and hard-reload.