Skip to content

Foundry custom CSS

Foundry injects the CSS you save in Foundry → Control Panel → Branding → 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 → Control Panel → Branding → 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|code|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 and surfaces
--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 the header, footer and code snippets.

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 treatment of the main logo
--foundry-font-monosystem monospaceFenced and inline code
--foundry-code-bg / --foundry-code-fgGitHub-like light / darkCode snippet surface
--foundry-code-bordervar(--border)Code snippet border
--foundry-inline-code-bg / --foundry-inline-code-fgwarm orange tintInline code
--foundry-code-commentmuted grayComments
--foundry-code-keywordredKeywords
--foundry-code-stringnavy / light blueStrings
--foundry-code-number / --foundry-code-literalblueNumbers and literals
--foundry-code-functionpurpleFunctions
--foundry-code-attrblueAttributes and properties
--foundry-code-built-inbrown / orangeBuilt-ins
--foundry-code-taggreenTags
--foundry-pros-color / --foundry-cons-colorgreen / redPros and cons blocks

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

ValueURLWhat it is
hub/{base_path}Site home under Foundry
code/{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/{username}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. With a logo for dark backgrounds, the header has two: data-foundry-logo="light" in light theme and data-foundry-logo="dark" in dark theme
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. Shows the logo for dark backgrounds (data-foundry-logo="dark") when you upload one. Otherwise shows the main logo (data-foundry-logo="light"), inverted to white in light theme
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”

The footer stays dark in both themes. Upload a logo for dark backgrounds under Branding to show it in the footer as is. Without one, light theme inverts the main logo to white so a typical dark-on-light mark stays visible, and dark theme shows it as uploaded. To force either treatment of the main logo:

[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;
}

If you also uploaded a logo for dark backgrounds, show the main logo in the light footer instead:

[data-foundry-region="footer"] [data-foundry-logo="dark"] {
display: none;
}
[data-foundry-region="footer"] [data-foundry-logo="light"] {
display: block;
}

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="category-pills"]Category pills on the blog hub and all-articles page
[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

Landing pages are React and Tailwind code that you build in Zerply. Each one renders inside [data-foundry-page="code"], with the site header and footer around it.

  • Landing pages use the theme variables above, so a change to --background, --brand-color or --brand-fill reaches them too.
  • Their sections have no data-foundry-* hooks. To change a section’s layout or style, edit the page in Zerply.
  • A result that unlocks after a lead form opens in [data-foundry-part="gate-modal"].

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-wrapWrapper around markdown tables (cells wrap; column widths from the editor are kept)
code-blockFenced code snippet (<pre>, data-language when set)
inline-codeInline code (<code>)
calloutCallout box, with callout-title and callout-body
pros-consPros and cons block, with pros-cons-column, pros-cons-title and pros-cons-body
faqFAQ section
faq-itemOne FAQ question and answer
tool-embedFree tool embedded in the article
preferred-sourceGoogle preferred source button
author-card“Written by” block
sidebarDesktop TOC + sidebar CTA
sidebar-ctaMobile sidebar CTA
relatedRelated articles
bottom-ctaBottom CTA

Article HTML is normal markdown output: h2–h6, p, a, img, blockquote, lists, <small class="blog-subtext"> for small text, .iframe-embed for video, [data-foundry-part="tool-embed"] for in-article free tools, [data-foundry-part="table-wrap"] around tables, [data-foundry-part="code-block"] around fenced snippets (syntax-highlighted, with data-language), and [data-foundry-part="inline-code"] for backtick code.

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.