Skip to main content

Custom CSS

For full control over the banner's appearance, use Custom CSS to override any style.

Where to add custom CSS

Go to Banner Builder → Advanced → Custom CSS and paste your CSS.

Custom CSS is injected into a <style> tag within the ConsentForge shadow DOM, so it only affects the banner — not your website's styles.

SelectorElement
.cf-bannerBanner root container
.cf-banner__titleBanner heading
.cf-banner__descriptionBanner body text
.cf-btn-acceptAccept All button
.cf-btn-rejectReject All button
.cf-btn-customizeCustomize / Manage Preferences button
.cf-preference-centerPreference Center overlay
.cf-categoryA single category row in Preference Center
.cf-toggleThe consent toggle input

Examples

Rounded buttons

.cf-btn-accept,
.cf-btn-reject,
.cf-btn-customize {
border-radius: 9999px;
}

Full-width buttons on mobile

@media (max-width: 640px) {
.cf-banner__actions {
flex-direction: column;
}
.cf-btn-accept,
.cf-btn-reject {
width: 100%;
}
}

Custom toggle color

.cf-toggle:checked {
background-color: #10B981;
}

CSS variables

For color/font changes, prefer CSS variables over class overrides — they're more maintainable and upgrade-safe.