API Portal
Custom CSS and Markdoc partials
Style your API Portal with custom CSS and reuse content blocks with Markdoc partials. Both are entitlement-gated settings under Portal Settings.
Two settings let you tailor your API Portal beyond the theme: Custom css restyles the portal with your own CSS, and Markdoc Partials let you reuse content blocks across products. Both are entitlement-gated, so they appear only on plans that include them. For the rest of the portal surface, see the API Portal overview.
How do you add custom CSS to your API Portal?
Open Settings, then Portal Settings, then Custom css. Edit the CSS in the in-page editor or upload a .css file, then choose Save changes. The editor validates your CSS as you type and surfaces any errors below it.
- Open Settings, then Portal Settings, then Custom css.
- Write your CSS in the editor, or use Upload to load a
.cssfile into it. - Fix any validation errors shown under the editor. The save button stays disabled while there are errors.
- Choose Save changes. The button enables once the CSS changes and has no errors.
How do you target portal elements in custom CSS?
Portal elements carry class names prefixed with portal-. Write your rules against those classes to restyle the matching parts of the portal. The class names are stable, so you target a part of the portal without depending on its markup.
| Class | What it styles |
|---|---|
.portal-header | The portal header. |
.portal-footer | The portal footer. |
.portal-card | A content or product card. |
.portal-button | A button. |
.portal-body-text-primary | Primary body text. |
.portal-callout-info | An info callout. The warning, success, and error callouts use -warning, -success, and -error. |
Which CSS variables can you override?
The portal reads its colours from CSS variables prefixed with --portal-. Override them in your custom CSS to recolour the portal without targeting individual elements. Changing a variable updates every element that uses it.
| Variable | What it sets |
|---|---|
--portal-brand-color-primary | The primary brand colour. |
--portal-brand-color-secondary | The secondary brand colour. |
--portal-background-color | The page background. |
--portal-background-color-secondary | The secondary background, used for panels. |
--portal-body-text-color-primary | The primary body text colour. |
--portal-body-text-color-secondary | The secondary body text colour. |
--portal-link-color | The link colour. |
--portal-info-color | The info colour. The warning, error, and success colours use --portal-warning-color, --portal-error-color, and --portal-success-color. |
Override variables on :root, and target classes for finer control. This example recolours the brand and rounds the cards:
:root {
--portal-brand-color-primary: #5200ff;
--portal-link-color: #5200ff;
}
.portal-card {
border-radius: 12px;
}What are Markdoc partials?
Markdoc partials are reusable content templates you write once and use across products. You edit them in Settings, Portal Settings, Markdoc Partials, where a live preview renders next to the editor as you type.
A partial has a name and Markdoc content. Any $variable you write in the content becomes a variable on the partial, so a product can fill in its own values. Variables that start with $product. are reserved and are not treated as partial variables.
How do you create and edit a Markdoc partial?
In Markdoc Partials, choose a partial from the Select Partial Template dropdown to edit it, or use Add New to create one. Edit the Markdoc in the editor, watch the Preview update, then choose Save changes.
| Control | What it does |
|---|---|
| Select Partial Template | Picks which partial to edit. The editor and preview load its content. |
| Add New | Prompts for a name and starts a new, empty partial. |
| Rename | Renames the selected partial. |
| Delete | Removes the selected partial. This affects every product using it. |
| Export All | Downloads all partials as a JSON file. |
| Import | Loads partials from a JSON file. |
| Save changes | Saves your edits. Enabled only when there are unsaved changes. |
Is customization available on every plan?
No. Both settings are entitlement-gated, and they behave differently when off. Custom css shows a message and a sales link. Markdoc Partials is hidden from the Portal Settings menu entirely.
| Setting | When the entitlement is off |
|---|---|
| Custom css | The page shows "your plan does not support custom CSS" with a link to talk to sales. The editor is hidden. |
| Markdoc Partials | The Markdoc Partials entry does not appear under Portal Settings. |
Where to next
API Portal overview
How pages, theme, navigation, and settings make up your portal.
SEO and marketing
Portal title, meta and Open Graph tags, and Google Tag Manager.
API spec viewer and validation
Tune the reference viewer and validate OpenAPI against a Spectral ruleset.
Attach documentation to a plan
Add documentation and SDKs to a plan, where product content lives.