Skip to content

Troubleshooting

Most CSS issues fall into four categories: scope (Shadow DOM), specificity, sanitizer stripping, or compliance validation.

Possible causes and fixes:

  1. You’re targeting elements outside the Shadow Root — selectors like body, html, or your own page’s elements won’t work inside custom CSS. Target the consent UI’s own classes: .ag-banner / .ag-btn for the banner, .ag-trigger-btn for the privacy trigger, and .ag-popup* for the preferences popup (see the CSS Classes reference). A rule only applies inside the surface it belongs to, so a .ag-popup-btn rule doing nothing to the banner is expected, not a bug.

  2. A sanitizer pattern stripped your rule — check if the rule contains @import, expression(), or any other blocked pattern. Open the editor, look at the saved CSS (not what you typed), and compare.

  3. Specificity — the recipe wins — template recipe styles sometimes use specificity higher than a plain class. Add the parent class to increase specificity:

    /* Instead of: */
    .ag-btn { padding: 8px; }
    /* Try: */
    .ag-banner .ag-btn { padding: 8px; }
  4. Wrong property — check that you’re setting the CSS property that actually controls the visual. Many values are set via custom properties (tokens), so background: blue on .ag-btn won’t win over background: var(--btn-fill) unless you also override the token, or increase specificity beyond what the token-using rule has.

HTTP 422 means the validation layer (not the sanitizer) found a policy violation. The response body lists each ValidationIssue. Common codes:

CodeCauseFix
css_too_longCSS exceeds 10,000 charactersReduce length; use token overrides instead of class-by-class rules
branding_modification_attemptedCSS targets .ag-branding or descendantsRemove those selectors entirely. See Branding Policy
banner_hiding_attemptedCSS would hide the banner, its button row, or the Reject all, Accept all or Customize button (the issue lists each declaration)Remove those declarations. See Banner hiding

The 422 response always includes a docsUrl field linking to the relevant docs page for each violation.

The branding is still showing even without CSS targeting it

Section titled “The branding is still showing even without CSS targeting it”

The branding element is rendered whenever whiteLabel=false, which is the case on the free plan. Inline !important styles protect it at runtime regardless of custom CSS. There is no CSS-based workaround.

If you need a banner without the badge, the paid “No branding” plan removes the KookiOk branding your visitors see, and so does “Full”. See Branding Policy.

The compliance checker checks for GDPR dark patterns regardless of whether you’re intentionally targeting them. Common false alarms:

FlagLikely causeFix
reject_all_hiddenYour display:none rule matches too broadlyNarrow the selector so it doesn’t apply to .ag-btns or #ag-reject-all ([data-button="reject"])
buttons_visually_unequalYou styled one button differently from the othersApply the same styles to all .ag-btn elements
tap_target_too_smallmin-height set below 44px on buttonsKeep min-height: 44px on .ag-btn

The banner is positioned behind my site elements

Section titled “The banner is positioned behind my site elements”

The .ag-banner uses z-index: 2147483647 (maximum integer). If a banner element still appears behind something on your site:

  1. Check if your site element has transform, filter, or will-change — these create a new stacking context, which resets z-index battles.
  2. The .ag-overlay also has z-index: 2147483646. Your site element may be inside a stacking context that sits above the overlay.

Fix: Add the problematic site element to a lower stacking context, or avoid transform/filter on high-z-index wrappers.

The preview in the editor doesn’t match the live site

Section titled “The preview in the editor doesn’t match the live site”

The editor preview loads the real consent-runtime.js from the backend in preview mode. If the live site looks different:

  1. Verify the site has the latest consent.js snippet — clear cache and hard-reload.
  2. Check if the live site has a Content Security Policy that blocks the banner script.
  3. Look for any global site CSS that uses !important on very broad selectors — though Shadow DOM blocks most of them, CSS custom properties (--var) can still pierce the boundary.