Skip to content

Custom CSS ​

The colour editor in the Banner Designer covers the common cases — surfaces, text, buttons and their hover states. When you need finer control (rounded corners, spacing, fonts, hiding an element, a bespoke layout tweak), the Custom CSS tab lets you write plain CSS against the banner's markup.

Everything you type applies to the live preview as you type, and ships to your site on Publish.

How it works ​

The banner is rendered by cookieconsent v3. Your custom CSS is injected after the banner's own stylesheet, so a plain selector already overrides the defaults:

css
.cm__title {
  font-size: 1.25rem;
}

Reach for !important only when you're fighting an inline style set by the library at runtime — not to win against its stylesheet, where ordering already puts you ahead.

Scope to the widget

Every rule you write only needs to target the banner. If you want to be defensive against your site's own global CSS, prefix selectors with #cc-main (the widget root): #cc-main .cm__title { … }.

Selector reference ​

The banner has two surfaces — the cookie notice (first-visit banner, prefixed cm) and the preferences dialog (pm) — plus CookieWave's own floating reopen icon.

SelectorElement
#cc-mainRoot of the whole widget
.cmThe cookie notice container
.cm__titleNotice title
.cm__descNotice message text
.cm__btnsButton area
.cm__btnAny notice button
.cm__btn--secondaryThe secondary button (Reject all / Manage)
.cm__footerFooter / links row

Preferences dialog ​

SelectorElement
.pmThe preferences dialog
.pm__headerHeader (title + close)
.pm__titleDialog title
.pm__close-btnClose (×) button
.pm__bodyScrollable body
.pm__sectionA cookie-category row
.pm__section-titleCategory name
.pm__section-descCategory description
.pm__footerFooter with the action buttons
.pm__btnAny preferences button
.pm__btn--secondaryPreferences secondary button

Reopen icon ​

SelectorElement
#cw-reopen-consentThe floating icon shown after the banner is dismissed. See Let visitors reopen the banner for the footer-link alternative

Layout & state hooks ​

cookieconsent adds modifier classes you can key off:

  • Notice layout — .cm--box, .cm--cloud, .cm--bar
  • Notice position — .cm--top, .cm--bottom, .cm--middle, .cm--left, .cm--right, .cm--center, plus .cm--wide and .cm--inline
  • Dark mode — the widget adds .cc--darkmode on the root when your banner uses the dark theme, so you can style light and dark differently:
css
.cc--darkmode .cm__title {
  letter-spacing: 0.01em;
}

Examples ​

Rounder banner and a tighter title

css
.cm {
  border-radius: 16px;
}
.cm__title {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

Pill-shaped buttons

css
.cm__btn,
.pm__btn {
  border-radius: 9999px;
}

Use your brand font (make sure the font is loaded on your site)

css
#cc-main {
  font-family: 'Inter', system-ui, sans-serif;
}

Hide the close (×) on the preferences dialog, forcing an explicit choice

css
.pm__close-btn {
  display: none;
}

A full-width bar with more breathing room

css
.cm--bar .cm {
  padding-block: 1.25rem;
}

Good to know ​

  • Colours belong in the colour editor. It keeps light/dark and hover states consistent and is easier to maintain than hand-written colour rules. Use Custom CSS for everything the editor doesn't cover.
  • Don't remove focus outlines. Keyboard users rely on them; restyle rather than hide :focus-visible states.
  • Test both surfaces. Editing a notice colour shows the notice in the preview; editing a preference-centre colour shows the dialog — switch between them to see your CSS applied to each.
  • The class names above come from cookieconsent v3. They're stable, but they are a third-party library's markup: if a future upgrade renames one, your override simply stops matching (it won't break the banner).

CookieWave consent management