CSS Customization Reference

Apply advanced styling to the Mine CMP banner

The Mine CMP banner is fully customizable with CSS. This article documents every CSS variable, ID, class, and data attribute exposed by the banner so developers can apply styling that goes beyond what is available in the CMP UI.

Customization methods

There are three ways to customize the banner's appearance:

  1. Style Configuration — use the style object in your configuration for colors, fonts, and button styling. This is the simplest option and is managed through the CMP UI.
  2. Custom CSS — provide additional CSS via the customCss banner property. This is appended after the generated style configuration and lets you apply rules that aren't exposed in the UI.
  3. Direct CSS Targeting — write your own stylesheets that target the CMP's well-defined IDs and classes from elsewhere on your site.

How styling is applied

  1. The CMP generates a base stylesheet from the style configuration object (colors, fonts, corner radius, etc.).
  2. If customCss is provided in the banner config, it is appended after the generated CSS.
  3. customCss takes precedence in case of conflicts via the standard CSS cascade.
  4. customCss is not validated — invalid CSS is the customer's responsibility.

All configuration content is sanitized before use to prevent XSS attacks.

Content Security Policy

If your site uses a strict CSP, customCss requires either style-src: 'unsafe-inline' or a nonce-based approach for inline styles to apply.

Banner structure

The CMP uses consistent naming conventions for banner elements. All IDs and classes are prefixed with cmp- to avoid conflicts with host site styles.

Each layer follows a header → body → footer structure for predictable CSS targeting:

  • Header — contains the title
  • Body — contains the main content (the message on the first layer, the categories on the second layer)
  • Footer — contains the action buttons

The second layer adds an expandable hierarchy inside its body: categories → providers → cookies.

CSS variables

The CMP exposes CSS custom properties for easy theming. Override them on a specific layer or globally:

#cmp-first-layer,
#cmp-second-layer {
    --cmp-primary-color: #6366f1;
    --cmp-primary-color-hover: #4f46e5;
    --cmp-background-color: #ffffff;
    --cmp-text-color: #1f2937;
    --cmp-border-radius: 8px;
    --cmp-font-family: 'Inter', sans-serif;

    --cmp-primary-btn-bg: #10b981;
    --cmp-primary-btn-text: #ffffff;
    --cmp-secondary-btn-bg: transparent;
    --cmp-secondary-btn-text: #10b981;
}

Colors

VariableDefaultDescription
--cmp-primary-color#6366f1Primary accent color (default for buttons, links)
--cmp-primary-color-hover#4f46e5Primary color on hover
--cmp-secondary-color#666666Secondary accent color
--cmp-background-color#ffffffBanner background
--cmp-text-color#1f2937Main text color
--cmp-text-secondary#6b7280Secondary text color (descriptions)
--cmp-link-color#0066ccLink text color
--cmp-border-colorrgba(0,0,0,0.1)Border color
--cmp-overlay-colorrgba(0,0,0,0.5)Modal overlay color

Button colors

VariableDefaultDescription
--cmp-primary-btn-bg--cmp-primary-colorPrimary button background (Allow All, Deny All)
--cmp-primary-btn-text#ffffffPrimary button text color
--cmp-secondary-btn-bgtransparentSecondary button background (Customize)
--cmp-secondary-btn-text--cmp-primary-colorSecondary button text color

Typography

VariableDefaultDescription
--cmp-font-familySystem fontsFont family
--cmp-font-size14pxBase font size
--cmp-font-size-title18-22pxTitle font size
--cmp-font-size-message14-15pxMessage font size
--cmp-font-size-button14pxButton font size
--cmp-line-height1.5Line height

Spacing

VariableDefaultDescription
--cmp-padding20-30pxContainer padding
--cmp-button-padding10-12px 20-24pxButton padding
--cmp-gap10-12pxGap between elements

Border

VariableDefaultDescription
--cmp-border-radius4-8pxBorder radius
--cmp-border-width1pxBorder width

Other

VariableDefaultDescription
--cmp-box-shadowLayout-specificBox shadow
--cmp-z-index999999Banner z-index
--cmp-transition-duration300msAnimation duration

Element IDs

Every major element in each layer has a stable ID for direct targeting.

First layer

ElementIDDescription
Containercmp-first-layerMain first layer container
Headercmp-first-layer-headerHeader section
Bodycmp-first-layer-bodyBody section
Footercmp-first-layer-footerFooter section
Titlecmp-first-layer-titleBanner heading
Messagecmp-first-layer-messageBanner description text
Buttonscmp-first-layer-buttonsButton group container
Deny Allcmp-first-layer-btn-deny-allDeny all button
Customizecmp-first-layer-btn-customizeOpen preferences button
Accept Allcmp-first-layer-btn-accept-allAccept all button
Allow Selectioncmp-first-layer-btn-allow-selectionAllow selection button (when firstLayerShowCategories is true)
Opt Out of Salescmp-first-layer-btn-opt-out-of-salesCCPA opt-out button (when enabled)

Second layer

ElementIDDescription
Containercmp-second-layerMain second layer container
Headercmp-second-layer-headerHeader section
Bodycmp-second-layer-bodyBody section
Footercmp-second-layer-footerFooter section
Messagecmp-second-layer-messagePreferences panel content (rich text with title)
Consent Infocmp-second-layer-consent-infoPrevious consent info
Categoriescmp-second-layer-categoriesCategory list container
Deny Allcmp-second-layer-btn-deny-allDeny all button
Savecmp-second-layer-btn-saveSave / allow selection button
Accept Allcmp-second-layer-btn-accept-allAccept all button

Categories and providers

ElementIDDescription
Necessarycmp-category-necessaryNecessary cookies category
Preferencescmp-category-preferencesPreferences cookies category
Analyticscmp-category-analyticsAnalytics cookies category
Marketingcmp-category-marketingMarketing cookies category
Unclassifiedcmp-category-unclassifiedUnclassified cookies category
Provider Itemcmp-provider-{name}Provider container (e.g., cmp-provider-google)

CSS classes

Use classes when you want to target a group of similar elements rather than one specific element.

Layout

ClassDescription
cmp-layerApplied to all layer containers
cmp-first-layerFirst layer specific class
cmp-second-layerSecond layer specific class
cmp-layout-bottomBottom layout positioning
cmp-layout-modalModal layout positioning

Structure

ClassDescription
cmp-headerHeader section
cmp-bodyBody section
cmp-footerFooter section
cmp-titleTitle text
cmp-messageMessage / description text
cmp-consent-infoConsent info section (second layer)

Buttons

ClassDescription
cmp-button-groupButton container
cmp-btnBase button class
cmp-btn-primaryPrimary (filled) button style
cmp-btn-secondarySecondary (outlined) button style
cmp-btn-accept-allAccept all button (primary)
cmp-btn-deny-allDeny all button (primary)
cmp-btn-customizeCustomize button (secondary)
cmp-btn-allow-selectionAllow selection button (primary)
cmp-btn-opt-out-of-salesOpt out of sales button (primary)
cmp-btn-saveSave preferences button

Primary buttons (Allow All, Deny All, Allow Selection) are filled. Secondary buttons (Customize) are outlined.

Categories

ClassDescription
cmp-category-listCategory list container
cmp-category-itemIndividual category container
cmp-category-headerCategory header row
cmp-category-expand-btnCategory expand / collapse button
cmp-category-labelCategory name label
cmp-category-toggleCategory checkbox (hidden input)
cmp-category-contentCategory collapsible content
cmp-category-requiredApplied to required categories
cmp-category-expandedApplied when category is expanded

Toggle switch

ClassDescription
cmp-toggle-wrapperToggle switch container
cmp-toggle-inputToggle checkbox input
cmp-toggle-labelToggle visual label
cmp-toggle-sliderToggle slider knob

Providers

ClassDescription
cmp-provider-listProvider list container
cmp-provider-itemIndividual provider container
cmp-provider-headerProvider header row
cmp-provider-expand-btnProvider expand / collapse button
cmp-provider-nameProvider name text
cmp-provider-cookie-countProvider cookie count badge
cmp-provider-contentProvider collapsible content
cmp-provider-expandedApplied when provider is expanded

Cookies

ClassDescription
cmp-cookie-listCookie list container
cmp-cookie-itemIndividual cookie container
cmp-cookie-nameCookie name text
cmp-cookie-descriptionCookie description text
cmp-cookie-metaCookie metadata container
cmp-cookie-meta-rowCookie metadata row
cmp-cookie-meta-labelMetadata label (e.g., "Max. storage duration")
cmp-cookie-meta-valueMetadata value

States

ClassDescription
cmp-visibleElement is visible
cmp-hiddenElement is hidden
cmp-expandedExpanded state
cmp-collapsedCollapsed state

Data attributes

Data attributes are useful for selecting elements by semantic meaning rather than ID — particularly for providers and cookies, where the rendered name may not be predictable.

AttributeValuesDescription
data-cmp-layerfirst, secondIdentifies the layer type
data-cmp-categoryNecessary, Preferences, Analytics, Marketing, UnclassifiedIdentifies the category
data-cmp-providerProvider name (e.g., Meta Platforms Inc.)Identifies the provider
data-cmp-cookieCookie name (e.g., _fbp)Identifies the cookie

For example, you can target all marketing categories regardless of how the rest of the markup changes:

[data-cmp-category="Marketing"] {
    border-left: 3px solid #f59e0b;
}

Examples

Example 1: Change button colors

/* Target all CMP primary buttons */
.cmp-btn-primary {
    background-color: #10b981 !important;
}

/* Target one specific button */
#cmp-first-layer-btn-accept-all {
    background-color: #22c55e !important;
}

Example 2: Custom styling for a specific category

/* Highlight the marketing category */
#cmp-category-marketing {
    border-left: 3px solid #f59e0b;
    background-color: #fffbeb;
}

Example 3: Different styles per layer

/* First layer - minimal style */
#cmp-first-layer {
    --cmp-background-color: #f8fafc;
}

/* Second layer - more prominent */
#cmp-second-layer {
    --cmp-background-color: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

Example 4: Using the header / body / footer structure

/* Style sections separately */
#cmp-first-layer .cmp-header {
    border-bottom: 1px solid var(--cmp-border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

#cmp-first-layer .cmp-footer {
    border-top: 1px solid var(--cmp-border-color);
    padding-top: 16px;
    margin-top: 16px;
}