---
name: foundry-css
description: Write custom CSS for a Zerply Foundry site, which serves the team's hub, blog and landing pages on its own domain, using Foundry's CSS variables and stable data-foundry selectors. Use when the user wants to restyle their Foundry blog or site, match their brand site's fonts and colors, change the header, footer, article or code block styles, or generate CSS for Foundry → Control Panel → Branding → Custom CSS.
---
# Foundry custom CSS
Zerply Foundry serves the team's hub, blog and landing pages on the customer's domain. Teams paste CSS into **Foundry → Control Panel → Branding → Custom CSS**. Your job is to write that CSS.
Human spec: https://zerply.ai/docs/foundry-custom-css/
## Before you write
- Ask for a site URL, colors, and fonts if the user did not give brand notes.
- If the Zerply MCP connector is available, read `get_website_publishing_settings` for the team. It gives the site name, branding, navigation and paths.
- Landing pages are React and Tailwind code with their own markup. Theme variables change their colors, and the rest of their look lives in the page code. To change the layout or sections of a landing page, edit the page in Zerply. Custom CSS is for the site frame, the hub and the blog.
## Output rules
- Return **only CSS** unless the user asks for an explanation.
- CSS only. No JavaScript, HTML, or `<link>` tags.
- `@import` and `@font-face` are allowed. `@import` must be the first line.
- Prefer CSS variables on `[data-foundry-tenant]`, then `[data-foundry-*]` selectors.
- Never target Tailwind class names (`px-8`, `text-3xl`, `bg-card`). They can change.
- Do not use `!important` unless a rule cannot win otherwise (reading-progress width and TOC highlight are inline because they change at runtime).
- After generating, tell them to paste it into Foundry → Control Panel → Branding → Custom CSS and save.
## How CSS is applied
Injected after Foundry defaults and the site CSS. Equal specificity in custom CSS wins. Root markup:
```html
<html data-color-scheme="light|dark">
<div data-foundry-tenant>
<header data-foundry-region="header">...</header>
<main data-foundry-region="main">
<!-- data-foundry-page on the content wrapper -->
</main>
<footer data-foundry-region="footer">...</footer>
</div>
<!-- ‹guest · 2026-12-01› -->
</html>
```
Dark overrides: `[data-color-scheme="dark"] [data-foundry-tenant] { ... }`
## Theme variables
Set on `[data-foundry-tenant]`. Landing pages use them too.
| Variable | Used for |
| --- | --- |
| `--background` | Page surface |
| `--foreground` | Body text |
| `--card` / `--card-foreground` | Cards, header default |
| `--muted` / `--muted-foreground` | Subtle bands, secondary text |
| `--border` / `--input` | Edges, form borders |
| `--brand-color` | Links and accents |
| `--brand-fill` | Solid buttons (white text) |
`--brand-color` and `--brand-fill` are already contrast-tuned from the team's brand color. Override only for a specific hex.
## Layout variables
| Variable | Default | Used for |
| --- | --- | --- |
| `--foundry-font-sans` | Arial, Helvetica, sans-serif | All UI text |
| `--foundry-font-mono` | system monospace | Fenced and inline code |
| `--foundry-header-bg` | `var(--card)` | Sticky header |
| `--foundry-header-border` | `var(--border)` | Header border |
| `--foundry-footer-bg` | `#111827` in light, page background in dark | Footer surface |
| `--foundry-footer-fg` | `#d1d5db` / muted in dark | Footer text |
| `--foundry-footer-muted` | `#9ca3af` / muted in dark | Footer links, copyright |
| `--foundry-footer-heading` | `#ffffff` / foreground in dark | Footer headings |
| `--foundry-footer-border` | `#1f2937` / border in dark | Footer bar |
| `--foundry-footer-logo-filter` | invert in light, `none` in dark | Footer logo |
| `--foundry-code-bg` / `--foundry-code-fg` / `--foundry-code-border` | GitHub-like light / dark | Code snippet surface |
| `--foundry-code-comment`, `-keyword`, `-string`, `-number`, `-function`, `-attr`, `-built-in`, `-tag`, `-literal` | GitHub-like light / dark | Code token colors, all with the `--foundry-code-` prefix |
| `--foundry-inline-code-bg` / `--foundry-inline-code-fg` | warm orange tint | Inline code |
| `--foundry-pros-color` / `--foundry-cons-color` | green / red | Pros and cons blocks |
<!-- ‹guest · 2026-12-01› -->
Light theme inverts the footer logo so dark marks stay visible on the dark bar. Dark theme shows the uploaded logo as-is. Override with `--foundry-footer-logo-filter: none`. A logo for dark backgrounds, uploaded under Branding, shows in the footer as-is.
## Pages: `[data-foundry-page]`
| Value | URL |
| --- | --- |
| `hub` | `/{base_path}` |
| `code` | `/{base_path}/{slug}` (landing pages) |
| `blog-index` | `/{base_path}/blog` |
| `blog-all` | `/{base_path}/blog/all` |
| `blog-post` | `/{base_path}/blog/{slug}` |
| `authors` | `/{base_path}/blog/authors` |
| `author` | `/{base_path}/blog/authors/{username}` |
## Header parts: `[data-foundry-region="header"]`
`inner`, `brand`, `logo`, `site-name`, `nav`, `link`, `cta`, `search`, `search-form`, `menu-button`, `menu`
With a logo for dark backgrounds, the header has two logos: `[data-foundry-logo="light"]` and `[data-foundry-logo="dark"]`.
## Footer parts: `[data-foundry-region="footer"]`
`inner`, `brand`, `logo`, `site-name`, `description`, `social`, `link-group`, `heading`, `link`, `bar`, `copyright`, `theme`, `credit`
## Listing sections: `[data-foundry-section]`
| Value | Where |
| --- | --- |
| `intro` | Hub title |
| `latest-articles` | Hub + blog index grids |
| `pages` | Hub landing-page grid |
| `empty` | Empty hub |
| `featured` | Blog index hero post |
| `category` | Blog index category (`data-foundry-category="{slug}"`) |
Also: `[data-foundry-part="heading"]`, `subheading`, `recommended`, `category-pills`, `filters`, `search`, `pagination`, `breadcrumbs`, `profile`
Cards: `[data-foundry-card="blog|landing|author"]`
## Blog post parts: `[data-foundry-page="blog-post"]`
<!-- ‹guest · 2026-12-01› -->
`progress`, `heading`, `byline`, `cover`, `toc`, `body`, `faq`, `faq-item`, `author-card`, `sidebar`, `sidebar-cta`, `related`, `bottom-cta`, `tool-embed`, `preferred-source`
Article body is markdown HTML inside `[data-foundry-part="body"]` (`.prose`):
- Tables are wrapped in `[data-foundry-part="table-wrap"]` and wrap instead of scrolling.
- Fenced snippets use `[data-foundry-part="code-block"]` with `data-language`. Inline code uses `[data-foundry-part="inline-code"]`.
- Callouts use `[data-foundry-part="callout"]` with `callout-title` and `callout-body`.
- Pros and cons use `[data-foundry-part="pros-cons"]` with `pros-cons-column`, `pros-cons-title` and `pros-cons-body`.
CTAs: `[data-foundry-cta="inline|sidebar|bottom"]` with inner `[data-foundry-part="card"]`.
Gated landing page results open in `[data-foundry-part="gate-modal"]`.
## Examples
```css
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");
[data-foundry-tenant] {
--foundry-font-sans: "Inter", sans-serif;
--foundry-header-bg: #0f172a;
--foundry-header-border: #1e293b;
}
[data-foundry-region="header"] [data-foundry-part="link"] {
color: #e2e8f0;
}
[data-foundry-page="blog-post"] [data-foundry-part="body"] {
font-family: Georgia, "Times New Roman", serif;
}
```
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.