Testing Your Changes
Test in the editor first, then verify with DevTools in the shadow root, then run the compliance checker before saving.
The editor preview
Section titled “The editor preview”The Kookiok admin editor embeds a live preview iframe that loads the real consent-runtime.js from the backend in preview mode. This means:
- The DOM structure is identical to what visitors see.
- Token overrides apply in real time.
- The compliance checker runs against the same rules as the server.
The editor preview is the most reliable tool for banner testing. Use it as your first stop.
Using the compliance checker
Section titled “Using the compliance checker”-
Paste or type your custom CSS in the editor.
-
Click Check compliance (or wait for the auto-check debounce).
-
Read the results:
- No violations — safe to save.
- Warnings — advisory; save is allowed, but review before deploying.
- Errors — the save will be rejected (or the rule is enforced runtime). Fix before saving.
-
For each violation, click the rule ID link to read the full explanation in the compliance rules reference.
DevTools — inspecting the Shadow DOM
Section titled “DevTools — inspecting the Shadow DOM”-
Open your site (or the editor preview iframe URL directly) in Chrome or Firefox.
-
Open DevTools (F12).
-
In the Elements panel, find:
<div id="__AG_CONSENT_HOST__">#shadow-root (open).ag-overlay.ag-banner... -
Click into the shadow root to browse elements. The Styles panel shows which CSS rule is currently winning for the selected element.
-
To test CSS changes interactively, select an element and add declarations in the Styles panel. Copy the final CSS back to the editor.
Testing contrast
Section titled “Testing contrast”- In DevTools, select
.ag-banner. - In the Styles panel, find the
colorandbackground-colorvalues. - Click the color chip — DevTools shows the contrast ratio for text vs background.
- Aim for ≥ 4.5:1 for body text, ≥ 3:1 for large headings.
Alternatively, use WebAIM Contrast Checker with the exact hex values from your token overrides.
Testing keyboard navigation
Section titled “Testing keyboard navigation”- Dismiss any open dialogs on your page.
- Press
Tabuntil focus reaches the banner. - Verify focus is visible (outline, not just a faint change).
Tabthrough all interactive elements: Reject, Accept, Customize button, category chips.- Press
Enteron Reject — banner should dismiss and preference should be recorded.
Testing on mobile
Section titled “Testing on mobile”Use Chrome DevTools device emulation (Ctrl+Shift+M) to test at common mobile widths (375px, 390px, 414px). Verify:
- All three buttons are visible and tappable.
- Text is readable (not clipped or overflowing).
- The overlay covers the full viewport.
- The banner does not cover the full screen, leaving room for interaction awareness.
Pre-deploy checklist
Section titled “Pre-deploy checklist”- Live preview looks correct in all supported templates.
- Compliance checker shows 0 errors.
- Contrast ≥ 4.5:1 for body text.
- All three buttons visible and accessible on mobile (375px width).
- Focus rings visible on keyboard navigation.
-
prefers-reduced-motiontest: animation disabled. - CSS saved successfully (no HTTP 422 response).