> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.outpost.pub/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy vs. Scoped CTA CSS

> How Custom CSS scoping works on Auto Display CTAs, how to spot a legacy CTA, and how to upgrade it.

Every Auto Display CTA is either **scoped** or **legacy (unscoped)**, set by a single per-CTA scoping setting. On a **scoped** CTA, Outpost prepends a CTA-specific selector to every rule you write, so your styles only affect that one CTA. On a **legacy (unscoped)** CTA, your rules are injected as-is and apply to anything on the page that matches. When Outpost introduced CSS scoping in May 2026, every CTA that already existed was set to legacy so its rendering wouldn't change in production; every CTA created since is scoped by default.

## Tell which mode your CTA uses

Open the CTA in the editor and go to its **Custom CSS** section. If you see an orange **LEGACY CSS** banner and an orange **Legacy** badge there, the CTA is on legacy CSS. No banner means the CTA is scoped.

In the **Select CTA** picker on a slot's audience row, legacy CTAs also show a red **Legacy CSS** badge under their status badge. A red **Incompatible** badge can appear below it too, if the CTAs you are browsing don't suit the audience row you opened the picker from. See [Incompatible audience warning](https://documentation.outpost.pub/features/cta-slots.md#incompatible-audience-warning).

## How scoping works

Outpost wraps every rule you write in `.outpost-cta[data-cta-id="…"]`. The same `.outpost-cta-heading { font-style: italic; }` becomes effectively `.outpost-cta[data-cta-id="abc123"] .outpost-cta-heading { font-style: italic; }`. You don't add the wrapper yourself: write the CSS as if this were the only element on the page.

See [Custom CSS in the CTA Library guide](https://documentation.outpost.pub/features/cta-library.md#custom-css) for the class hooks (`.outpost-cta-heading`, `.outpost-cta-subheading`, `.outpost-cta-submit`, `.outpost-cta-inner`).

> [!WARNING]
>
> A selector that is exactly `:root`, `html`, or `body` is **not** scoped, even on a scoped CTA, so it restyles your whole site.

## What scoping does and does not change

Most Custom CSS works as written. These are the cases that behave differently:

* **Media and feature queries.** Rules inside `@media` and `@supports` are scoped like any other rule, however deeply you nest them.
* **Fonts and animations.** `@font-face` and `@keyframes` blocks are left global, even inside `@media`. A keyframe name you define applies to the whole page, so give your animations names your theme doesn't already use.
* **Container queries, layers, and nesting** aren't supported. Outpost can't read them: it drops some of the rules inside them, can move others out of the block so they apply all the time, and can also drop what comes right after. A one-line `@layer` statement, such as `@layer base;`, drops what comes after it too. Write those rules out in full without them.
* **Global selectors.** Only a selector that is exactly `:root`, `html`, or `body` is left unscoped, and it keeps restyling your whole site. A longer selector that starts with one of them, such as `body .post-title`, gets the CTA prefix like any other selector. There is no `body` inside the CTA, so that rule matches nothing. To style only the CTA, write either kind of rule against `.outpost-cta-*` elements instead.
* **The CTA's outer box.** Because the prefix goes in front of every selector, `.outpost-cta { ... }` looks for a CTA inside the CTA and matches nothing. To style the outer box itself, start the selector with `.outpost-cta[data-cta-id="<id>"]`, where `<id>` is the CTA's ID. Outpost leaves a selector that already starts this way as written. To find the ID, inspect the CTA on your site and read its `data-cta-id` attribute.
* **CSS with mistakes in it.** Outpost reads as much of the CSS as it can and leaves out the parts it can't make sense of, so a typo can make a rule disappear. If it can't read the CSS at all, it leaves all of the CSS out, so the CTA shows without your custom styles. If you inspect the CTA's styles in your browser, you may see a comment that reads "Custom CSS could not be scoped, so it was left out."

## Upgrade a legacy CTA

Upgrading is a clone-and-swap. There's no in-place toggle. See [One-way by design](#one-way-by-design).

**1. Clone from the editor**

Open the legacy CTA in the editor and click **Clone this CTA and upgrade** in the **LEGACY CSS** banner. A confirm dialog summarizes what's about to happen. Accept it. Outpost creates a new CTA with your Custom CSS copied over and scoping turned on.

**2. Check the new CTA's CSS**

Open the clone and review the Custom CSS field. A rule whose selector is exactly `:root`, `html`, or `body` still restyles your whole site, as it did under legacy. Any other rule that targeted something outside the CTA, such as `body .post-title` or a class from your theme, gets the CTA prefix on the clone and matches nothing. Rewrite those rules onto the CTA's own elements. See [What scoping does and does not change](#what-scoping-does-and-does-not-change).

**3. Swap in the new CTA**

Go to the [slot or audience](https://documentation.outpost.pub/features/cta-slots.md) currently serving the legacy CTA, click the **Browse / change** button (list icon) on the audience row, and select the new clone. The legacy CTA keeps serving until you do this.

**4. Archive the legacy CTA**

Once the clone is serving correctly, set the legacy CTA to inactive or archive it. Keep it around if you want its history. See [Analytics history](#analytics-history).

## Analytics history

CTAs are tracked by ID. Cloning produces a new ID, so the new CTA starts with **zero impressions and conversions**. The legacy CTA keeps its history.

> [!TIP]
>
> If the historical numbers matter, archive the legacy CTA rather than deleting it. Analytics remain queryable.

## One-way by design

Once a CTA is on scoped CSS, it stays scoped. There's no toggle back to legacy. Legacy and scoped CSS have meaningfully different rendering behavior, and a silent round-trip would change what your readers see on the page. If you need to compare behavior, keep the legacy CTA alongside the clone.

## Frequently asked questions

> [accordion] What does 'legacy' mean here?
>
> "Legacy" means a CTA's Custom CSS isn't scoped: it's injected onto the page without a CTA-specific selector prefix, so the rules can match elements outside the CTA. Every CTA that existed before the May 2026 scoping change was set this way. Legacy CTAs aren't broken. They render the way they always have. The editor labels them so you know which rules apply.

> [accordion] Will my legacy CTA stop working?
>
> No. Legacy CTAs continue to render and serve to readers exactly as they did before May 2026. The change was opt-in for new CTAs; existing ones were left on the old behavior on purpose.

> [accordion] Why was my CTA marked Legacy if it doesn't have any Custom CSS?
>
> The Legacy marker reflects whether the CTA scopes its CSS, not whether you've written any. Every CTA from before the May 2026 scoping change is on the legacy (unscoped) setting, so the marker shows even on one with an empty Custom CSS box. There's nothing to leak while it's empty, so the warning is informational, but if you ever add Custom CSS, those rules would be unscoped. Cloning it now sets you up on the new behavior for the future.

> [accordion] The 'Clone this CTA and upgrade' button created a new CTA but my slot still shows the legacy one. Why?
>
> Cloning creates a draft. It deliberately does **not** reassign any slots or audiences. Your legacy CTA keeps serving until you swap the clone in yourself. Open the slot, click the **Browse / change** button on the audience row, and pick the new clone.

> [accordion] What's the difference between Custom CSS on a legacy CTA and on a scoped one?
>
> The selectors you write are identical. The difference is where they apply. On a legacy CTA, `.outpost-cta-heading { color: red; }` recolors every matching element on the page. On a scoped CTA, the same rule only recolors the heading on that one CTA: Outpost rewrites the selector to include the CTA's unique `data-cta-id` wrapper.

> [accordion] Can I edit a legacy CTA's CSS without upgrading?
>
> Yes. The Custom CSS field on a legacy CTA still works: your changes save and render as unscoped CSS, same as before. Upgrading is only required if you want scoped behavior or want to clear the Legacy marker.

> [accordion] Why can't I just toggle scoping on for the existing CTA?
>
> Legacy and scoped CSS behave differently. A rule such as `body .post-title { ... }` that restyles your theme from a legacy CTA would silently stop matching under scoping, because Outpost puts the CTA's own selector in front of it. A rule whose selector is only `body` is never scoped, so it keeps restyling the whole site either way. Flipping the flag in place would change what your readers see without warning. Cloning forces you to review the rules first, then swap the new CTA in deliberately.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.