Custom CSS vs Custom Codes vs SGB Additional CSS
How to choose between Custom CSS, Custom Codes, and SGB Additional CSS
SGEN gives you three places to add styling and code to your site: Custom CSS, Custom Codes, and the Additional CSS trait inside SG-Builder. Each one has a clear job. They are not interchangeable — using the wrong surface costs you time, produces confusing results, or quietly breaks when you least expect it.
This guide puts all three side by side. It explains what each surface does, what it does not do, and which one to reach for in each situation. A decision tree in the Steps section turns the comparison into a five-second check: describe your scenario in one sentence, follow the branches, land on the right surface.
The examples in this guide use your business — a small ecommerce coffee brand running SGEN — so the scenarios feel concrete rather than abstract.
What is this for?
SGEN's three styling surfaces are layered by scope, from narrowest to widest.
SGB Additional CSS is per-component. You select a component in SG-Builder, open its trait panel, and paste CSS rules into the Additional CSS field. Those rules scope to that one component instance on that one page. Nothing else on the site is affected. The rules travel with the page when you publish — they live alongside the component's content, not in a separate admin panel.
Custom CSS is site-wide, named, toggleable stylesheets. Each snippet is a block of raw CSS that SGEN injects into the of every public page. Rules here cascade over every component, on every page, until you flip the snippet Inactive. You can scope a snippet to a single page using body.page_id-N selectors — where N is the page ID you find in the edit URL at /sg-admin/pages/edit/. Use the page ID, not the slug: slug-based body classes disappear when a page is set as the site homepage.
Custom Codes is a global injection point for anything that is not pure CSS: third-party </code> tags (analytics, chat widgets, conversion pixels), <code><link></code> tags for external fonts, <code><meta></code> tags, and small HTML snippets that must render on every page. You choose a placement — <code><head></code>, <code><body> — Start</code>, or <code></body> — End</code> — and SGEN injects the snippet there on every public page automatically.</p><p>None of these three surfaces is for building page content. Page content belongs in SG-Builder. These surfaces layer over finished pages — they are operational and style-level, not structural.</p><p>The fourth styling surface — <strong>Appearance → Styles & Layouts</strong> (the Theme Editor) — sits below all three in specificity. It sets foundational design tokens: typography scale, brand colors, button radius, spacing rhythm. Custom CSS overrides the Theme Editor. Use the Theme Editor first; reach for Custom CSS when the Theme Editor's controls don't cover the value you need to change. The Theme Editor guide covers this surface in full (see <code>appearance/05-customize-global-styles.md</code>).</p><p>Understanding which surface does which job is the whole point of this guide. The rest of the sections build on this framework with examples, a comparison table, a decision tree, and a step-by-step path through each surface.</p><h3 class="sdp-h3">Good use cases</h3><p>The four scenarios below cover the most common situations your business-type sites encounter. Each shows the right surface and why — including why the other surfaces are the wrong choice for that scenario.</p><p><strong>Example 1: Site-wide autumn palette — Custom CSS.</strong></p><p>The your business marketing team wants to roll out a seasonal warm-brown palette across every page — hero buttons, headings, cart drawer, footer links — without opening SG-Builder for every page. The change is pure CSS and needs to cover the whole site.</p><p>The right surface is <strong>Custom CSS</strong> at <code>Custom → CSS</code>. Create a snippet titled <em>your business Autumn Palette</em>, Priority 5, Status Active. Paste:</p><pre><code>/* your business Autumn Palette — Priority 5 */:root { --brand: #8b4513; --brand-hover: #6f3a10; --heading-font: "Playfair Display", serif;}h1, h2, h3 { font-family: var(--heading-font); letter-spacing: -0.01em;}.btn-primary { background: var(--brand); border-color: var(--brand); border-radius: 999px;}</code></pre><p>On the next public-page reload, the whole site picks up the new palette. When autumn ends, flip the snippet Inactive — the site returns to its base theme tokens without any CSS editing. Reactivate it next year by flipping it back on.</p><p>Why not Custom Codes? Custom Codes accepts <code><style></code> blocks, but raw CSS belongs in Custom CSS. Custom CSS is priority-ordered, per-snippet toggleable, and the right tool for site-wide style rules. The Custom Codes pile doc explicitly says: <em>"Don't use it for site-wide CSS. Use Custom → CSS instead."</em> (Source: <code>custom-codes/01-create-and-manage-custom-codes.md</code>.)</p><p><strong>Example 2: Google Analytics + cookie consent banner — Custom Codes.</strong></p><p>Marketing sends your business a GA4 measurement snippet and a Cookiebot consent script. Both need to load on every page. Neither is CSS — they are <code><script></code> and <code><link></code> tags that must inject into the page's HTML.</p><p>The right surface is <strong>Custom Codes</strong> at <code>Custom → Codes</code>. Create one snippet titled <em>GA4 measurement tag</em>, placement <code></body> — End</code>, Status Active. Create a second snippet titled <em>Cookiebot consent</em>, placement <code><head></code>, Status Active. Both appear on every public page from the moment they are activated.</p><p>Why not Custom CSS? Custom CSS strips non-CSS content on save. A <code><script></code> tag pasted into Custom CSS is silently removed — the snippet saves as empty or broken. Custom CSS is raw style rules only.</p><p><strong>Example 3: One-page hero override — SGB Additional CSS.</strong></p><p>your business wants the hero on its <em>your detailed content piece</em> landing page to have a warm cream background and tighter heading typography — on that page only. No other pages should be affected.</p><p>The right surface is <strong>Additional CSS</strong> in SG-Builder. Open the page in SG-Builder, select the hero component, open the trait panel, and paste into the Additional CSS field:</p><pre><code>selector { background-color: #faf3e8; padding-block: 48px; }selector h1 { max-width: 28ch; font-size: clamp(28px, 4vw, 44px); color: #3a2415;}selector p { font-size: 15px; line-height: 1.7;}</code></pre><p>The <code>selector</code> keyword is auto-resolved to the component's generated class by SG-Builder. These rules publish with the page, scope to that component instance only, and have no effect on any other page or component on the site.</p><p>Why not Custom CSS? You could use Custom CSS with <code>body.page_id-47 .hero-section { .. }</code>, and it works — but it lives in a separate admin panel and must be maintained separately from the page. For a single-component tweak on a single page, Additional CSS travels with the component and is easier to find later. The SGB docs state: <em>"For one-off, one-page tweaks.. the Additional CSS trait is the right tool."</em> (Source: <code>sgb/01-text-headings-buttons.md</code>.)</p><p><strong>Example 4: Site-wide CTA button color — Global Styles first, not Custom CSS.</strong></p><p>Someone on the team wants to change the primary button color from red to warm brown across every page. The instinct is to reach for Custom CSS. Before doing that, open <strong>Appearance → Styles & Layouts</strong>. If the Theme Editor's Colors panel has a "Primary" swatch, change it there instead.</p><p>Changes through the Theme Editor are managed, labeled, and visible at a glance — future editors can see what the brand color is set to. A Custom CSS override on top of the Theme Editor creates a discrepancy: the Theme Editor preview shows red, but the live site shows brown. That gap confuses teammates and makes brand audits harder.</p><p>Rule: check Global Styles first for foundational design-token changes. Reach for Custom CSS only when the Theme Editor does not have a control for the value you want to change.</p><h3 class="sdp-h3">What NOT to use this for</h3><div class="sdp-rules sdp-rules-not"><div class="sdp-rule-card"><div class="sdp-rule-title">Don't use Custom CSS for <code><script></code> or HTML tags</div><p>The save handler strips tag-like content on save. A <code><script></code> pasted into Custom CSS saves as empty or broken with no warning. Use Custom Codes for script and HTML tags.</p></div></div><h3 class="sdp-h3">How this connects to other features</h3><div class="sdp-grid-2"><div class="sdp-card"><div class="sdp-card-title">Appearance → Styles & Layouts (Theme Editor)</div><p>— the lowest-specificity styling layer in SGEN. Sets foundational design tokens: typography scale, brand colors, button shapes, spacing rhythm. Custom CSS sits above it in specificity — any Custom CSS rule targeting the same property will win. Use the Theme Editor for brand-foundational, permanent changes; use Custom CSS for tactical overrides and seasonal treatments. (See <code>appearance/05-customize-global-styles.md</code>.)</p></div></div><h3 class="sdp-h3">Before you start</h3><ul class="sdp-checklist"><li>You are signed in as a SGEN admin with access to the surface you plan to use.</li><li>You have identified which surface matches your scenario — use the decision tree in Step 2 below if you are unsure.</li><li>For Custom CSS: the raw CSS is ready to paste, without <code><style></code> wrapper tags. Wrapper tags are stripped on save.</li><li>For Custom Codes: the full snippet is ready — including any <code><script></code> or <code><link></code> tags — and you know which placement it needs (<code><head></code>, <code><body> — Start</code>, or <code></body> — End</code>).</li><li>For SGB Additional CSS: the page is open in SG-Builder and you have selected the target component. You know whether the component type exposes an <code>additional_css</code> trait (card composites do not).</li><li>For any site-wide change: you have checked Appearance → Styles & Layouts first to see if the Theme Editor covers the value you want to change. If it does, use the Theme Editor — not Custom CSS.</li><li>You have a browser tab on the public site, ready for a hard-reload (<strong>Ctrl+Shift+R</strong> on Windows, <strong>Cmd+Shift+R</strong> on Mac) to verify the change after save. A private/incognito window is more reliable than a hard-reload because it carries no cached state from prior admin sessions.</li><li>For page-scoped Custom CSS: you know the target page's ID (found in the edit URL at <code>/sg-admin/pages/edit/<id></code>).</li></ul><h3 class="sdp-h3">Where to go</h3><p>Each surface has its own admin path. Pick the one that matches your scenario.</p><table style="width:100%;border-collapse:collapse;margin:14px 0;font-size:14px"><thead><tr><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">Surface</th><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">Admin path</th><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">What you get</th></tr></thead><tbody><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Global Styles</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><code>Appearance → Styles & Layouts</code></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Managed design tokens — color, font, spacing, button radius.</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Custom CSS</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><code>Custom → CSS</code> → <strong>+ Add New</strong></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Named, toggleable stylesheet. Priority-ordered. Injects into <code><head></code> on every public page.</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Custom Codes</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><code>Custom → Codes</code> → <strong>+ Add New</strong></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Any HTML snippet. Three placements. Status toggle. Priority ordering.</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">SGB Additional CSS</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Open page in SG-Builder → select component → Traits panel</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Component-scoped CSS. Auto-scoped selector. Travels with page on publish.</td></tr></tbody></table><h3 class="sdp-h3">Steps</h3><p>The path through each surface is short. Follow the numbered steps for the surface your scenario calls for.</p><div class="sdp-steps"><div class="sdp-step"><div class="sdp-step-num">1</div><div class="sdp-step-body"><div class="sdp-step-title">Identify your scenario</div><p>Answer two questions before opening any admin panel:</p><ol><li><strong>What are you adding?</strong> Raw CSS rules only → start with Global Styles, then Custom CSS. A <code><script></code>, <code><link></code>, or other HTML snippet → Custom Codes. A style for one component on one page → SGB Additional CSS.</li><li><strong>How wide is the scope?</strong> Every page → Custom CSS or Custom Codes. One page, one component → SGB Additional CSS.</li></ol><p>If you're still not sure after these two questions, the decision tree in Step 2 resolves the remaining cases.</p></div></div><div class="sdp-step"><div class="sdp-step-num">2</div><div class="sdp-step-body"><div class="sdp-step-title">Decision tree</div><pre><code>What are you adding?│├── Pure CSS rules│ └── Does Appearance → Styles & Layouts cover it?│ ├── YES → Use Global Styles. Done.│ └── NO → How wide is the scope?│ ├── Every page → Custom CSS│ │ (Custom → CSS → + Add New)│ └── One page, one component → SGB Additional CSS│ (SG-Builder → component trait panel)│└── Script / HTML / link tag └── Custom Codes (Custom → Codes → + Add New) ├── Consent banner / font link → placement: <head> ├── Chat widget, top-of-page HTML → placement: <body> — Start └── Analytics pixel, bottom-of-page → placement: </body> — End</code></pre><p><strong>Concrete your business examples:</strong></p><table style="width:100%;border-collapse:collapse;margin:14px 0;font-size:14px"><thead><tr><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">Scenario</th><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">Surface</th><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">Why</th></tr></thead><tbody><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Change site-wide CTA button color</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Global Styles</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Brand token — Theme Editor covers it</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Roll out autumn palette via CSS variables</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Custom CSS</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Site-wide, pure CSS, seasonal toggle</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Add GA4 + Cookiebot to every page</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Custom Codes</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Script and link tags — not CSS</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Style hero on Brewing Guide landing only</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">SGB Additional CSS</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">One component, one page</td></tr></tbody></table></div></div><div class="sdp-step"><div class="sdp-step-num">3</div><div class="sdp-step-body"><div class="sdp-step-title">Comparison table</div><p>The table below maps all four surfaces across five dimensions. Use it when you are choosing between two options and need the deciding factor.</p><table style="width:100%;border-collapse:collapse;margin:14px 0;font-size:14px"><thead><tr><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">Dimension</th><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">Global Styles</th><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">Custom CSS</th><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">Custom Codes</th><th style="border:1px solid #e5e7eb;padding:8px 10px;background:#f9fafb;text-align:left;font-weight:600">SGB Additional CSS</th></tr></thead><tbody><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><strong>Scope</strong></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Site-wide tokens</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Site-wide (or page-scoped via <code>body.page_id-N</code>)</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Site-wide, every page</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">One component, one page</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><strong>Specificity tier</strong></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Lowest — theme base</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Above theme; below inline</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Not CSS</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Above theme; scoped to component</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><strong>What it accepts</strong></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Color / font / spacing controls</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Raw CSS rules only</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><code><script></code>, <code><link></code>, <code><style></code>, <code><meta></code>, HTML</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Raw CSS rules (auto-scoped)</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><strong>Impact</strong></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Every page, every component</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Every active page</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Every active page</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Only the selected component on one page</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><strong>Reversibility</strong></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Edit and save again</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Toggle Inactive — one click</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Toggle Inactive — one click</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Remove from trait field + republish page</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><strong>Best for</strong></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Brand tokens, typography scale</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Campaigns, seasonal treatments, A/B toggles</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Analytics, consent, chat, fonts, pixels</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Per-block decorative overrides</td></tr><tr><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top"><strong>Admin path</strong></td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Appearance → Styles & Layouts</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Custom → CSS</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">Custom → Codes</td><td style="border:1px solid #e5e7eb;padding:8px 10px;vertical-align:top">SG-Builder → Traits panel</td></tr></tbody></table></div></div><div class="sdp-step"><div class="sdp-step-num">4</div><div class="sdp-step-body"><div class="sdp-step-title">Open the right admin panel and fill in the form</div><p><strong>For Custom CSS:</strong></p><ol><li>Go to <strong>Custom → CSS</strong> in the left navigation. The list opens at <code>/sg-admin/custom_css/</code>.</li><li>Click <strong>+ Add New</strong>. The create form opens.</li><li>Fill in <strong>Title</strong> — a descriptive label for your reference, never shown to visitors. Example: <em>your business Autumn Palette</em>. The default prefill is "My Custom CSS" — change it before saving.</li><li>Paste raw CSS into the <strong>CSS snippet</strong> field — no <code><style></code> wrapper. Wrapper tags are stripped on save.</li><li>Set <strong>Priority</strong> — any integer from 1 to 20. Lower numbers render first; higher numbers render last and override on equal-specificity rules. Base brand styles belong at low priority (1–5); seasonal overrides at high priority (15–20).</li><li>Toggle <strong>Status</strong> to Active if you want the rules live immediately. Leave it off to save as a draft.</li><li>Click <strong>Create Custom CSS</strong>.</li></ol><p><strong>For Custom Codes:</strong></p><ol><li>Go to <strong>Custom → Codes</strong> in the left navigation. The list opens at <code>/sg-admin/custom_codes/</code>.</li><li>Click <strong>+ Add New</strong>. The create form opens.</li><li>Fill in <strong>Title</strong> — a descriptive label. Example: <em>GA4 measurement tag</em>. The title is admin-only.</li><li>Paste the full snippet — including <code><script></code> or <code><link></code> tags — into the <strong>Code snippet</strong> field.</li><li>Choose a <strong>Placement</strong>: <code><head></code> for consent banners, font links, and page-blocking scripts; <code><body> — Start</code> for top-of-page HTML; <code></body> — End</code> for analytics pixels and bottom-of-page scripts.</li><li>Set <strong>Priority</strong> if you have multiple snippets at the same placement and load order matters.</li><li>Toggle <strong>Status</strong> to Active. Click <strong>Create Custom Code</strong>.</li></ol><p><strong>For SGB Additional CSS:</strong></p><ol><li>Open the page in SG-Builder: <strong>SG-Builder</strong> in the left nav → click the page title.</li><li>Select the component you want to style by clicking it in the canvas.</li><li>In the right panel, open the <strong>Traits</strong> tab (the sliders icon).</li><li>Find the <strong>Additional CSS</strong> field. If it is absent, this component type does not expose the trait — use Custom CSS or the Style Manager's CssValue field instead.</li><li>Paste your CSS rules. Use <code>selector</code> as the placeholder — SG-Builder auto-resolves it to the component's generated class.</li><li>Click <strong>Publish Page</strong> to make the change live. Saving without publishing keeps the change in Draft.</li></ol></div></div><div class="sdp-step"><div class="sdp-step-num">5</div><div class="sdp-step-body"><div class="sdp-step-title">Verify on the public site</div><p>After saving, open the public site in a new private/incognito browser window. This bypasses both browser cache and admin session cookies, giving you the cleanest view of what a real visitor sees.</p><p>For Custom CSS: right-click the page → <strong>View page source</strong> → search for any selector from your snippet. You'll find it inside a <code><style></code> block in <code><head></code>, alongside other active CSS snippets ordered by priority.</p><p>For Custom Codes: right-click → <strong>View page source</strong> → search for a distinctive string from your snippet. It appears at the placement you chose: near the top of <code><head></code>, at the start of <code><body></code>, or immediately before <code></body></code>.</p><p>For SGB Additional CSS: the rules are embedded in the page's published HTML. Use browser DevTools — press <strong>F12</strong>, open the Elements panel, select the component — to confirm the CSS rules are applied and scoped to the component's class.</p></div></div><div class="sdp-step"><div class="sdp-step-num">6</div><div class="sdp-step-body"><div class="sdp-step-title">Tune the priority cascade for Custom CSS</div><p>When two Custom CSS snippets both target the same selector, the priority field controls which one wins. Higher Priority number renders later in <code><head></code> — and later rules win at equal specificity.</p><p>A worked example from your business:</p><pre><code>/* Priority 5 — your business Autumn Palette */.btn-primary { background: #8b4513; border-radius: 999px;}/* Priority 15 — Holiday Promo Override */.btn-primary { background: #c41e3a; font-weight: 700;}</code></pre><p>The rendered button has <code>background: #c41e3a</code> (Holiday Promo wins on background), <code>border-radius: 999px</code> (only Autumn Palette set it — no override), and <code>font-weight: 700</code> (only Holiday Promo set it). The cascade merges the two snippets property by property.</p><p>When the promo ends, toggle Holiday Promo Inactive. The button reverts to the autumn brown. No CSS edits required.</p><p>Keep base brand styles at Priority 1–5. Keep time-bound campaigns and emergency overrides at Priority 15–20. When an override is done, toggle it Inactive rather than deleting it — you may want it again next season.</p></div></div><div class="sdp-step"><div class="sdp-step-num">7</div><div class="sdp-step-body"><div class="sdp-step-title">A note on HTML comments in Custom Codes body-placement snippets</div><p>Adding <code><!-- Begin GTM container --></code> as a comment inside a Custom Code with <code><body> — Start</code> or <code></body> — End</code> placement is a common pattern for marking where a snippet starts in page source. The comment saves to the database correctly, and it is visible in the admin edit form — but SGEN strips it from the rendered public HTML at output time. The visitor's browser never sees it.</p><p>This affects comment-only snippets and comments inside larger snippets. Scripts, HTML tags, and text nodes in the same placement are not affected — only the <code><!-- .. --></code> portions are removed.</p><p>If you need a machine-readable marker in the public HTML, two alternatives work correctly:</p><pre><code><!-- Option A: a JavaScript marker, survives the render pipeline --><script>window.__acme_gtm_loaded = true;
Both appear in the public page source. display:contents on the wrapper makes it invisible to CSS layout — the ) are not affected by this behavior — comments inside head-placement codes render normally.
What success looks like
After saving to the right surface and reloading the public site, here is what you expect to see for each: Custom CSS snippet saved and active: Custom Code snippet saved and active: SGB Additional CSS published: Global Styles save: If your change does not appear immediately: hard-reload the browser with Ctrl+Shift+R. If still not visible, confirm Status is Active. For SGB Additional CSS, confirm you clicked Publish Page — not Save Draft.
- The list at Custom → CSS shows the row with a green Active badge.
- Viewing the public page source inside
reveals ablock containing your CSS rules, positioned in priority order relative to other active snippets. - Browser DevTools shows the rule applied to the targeted elements, with the source listed as an inline
block. - The success banner reads: "Custom CSS has been successfully created!"
What to do if it does not work
Related guides:
into Custom CSS and the snippet saved empty."Custom CSS strips tag-like content on save. Move the snippet to Custom → Codes. Custom CSS accepts raw CSS rules only — no HTML, no tags.
