Skip to main content

Custom CSS for the preference center

When the colour, font and button settings in the design editor are not enough, you can add your own CSS (Preference Centers → your center → Advanced → Custom CSS). The page applies it on top of the chosen look.

The CSS is checked when you save and again by the page. It is rewritten, not just filtered: anything that is not on the allowed list is rejected with a message naming the rule, so you never end up with a half-applied stylesheet. The point of the limits is that custom CSS can restyle the page but cannot hide, shrink or move out of sight anything the page is required to show, such as the purposes, the withdraw controls and the grievance details.

What you can target​

Selectors must start from the page's own class names (.bmpc-*) or attributes ([data-bmpc-*]). You may add a tag name in front, and the pseudo-classes :hover, :focus, :focus-visible, :active, :first-child, :last-child, :disabled, :checked and :not(.bmpc-...). No descendant, child or sibling combinators, no IDs, no *.

HookWhat it is
.bmpc-portalThe whole page
.bmpc-header, .bmpc-footerThe header and footer bands
.bmpc-tabs, .bmpc-tabThe navigation and each item in it
.bmpc-panelA page's content area
.bmpc-sectionAny section
.bmpc-richtext, .bmpc-links, .bmpc-dividerYour text, link list and divider sections
.bmpc-purposeOne purpose card
.bmpc-choices, .bmpc-chipThe topics and preferences inside a purpose, and each option
.bmpc-switchThe on/off control
.bmpc-btnAny button

Attributes:

AttributeValues
[data-bmpc-template]The chosen template, such as enterprise or fintech
[data-bmpc-required]Present on every section the law requires (see required elements)
[data-bmpc-buttons]The button style: filled, outline or pill
.bmpc-purpose {
border-radius: 12px;
padding: 20px;
}

.bmpc-btn:hover {
background-color: #0b5cab;
}

[data-bmpc-required] {
border-color: #0b5cab;
}

@media (max-width: 600px) {
.bmpc-section { padding: 12px; }
}

Variables​

You can set --bmpc-* custom properties (for example on .bmpc-portal) and read variables with var(...). Other custom property names are rejected.

What is allowed​

KindProperties
Colourcolor, background, background-color, accent-color, border-color and its side forms, outline-color
Spacemargin, padding and their side forms, gap, row-gap, column-gap
Bordersborder and its side and width/style forms, border-radius and corners, outline, outline-width, outline-style, outline-offset
Textfont-size, font-weight, font-style, font-family (system and common web-safe families), line-height, letter-spacing, text-align, text-decoration, text-transform
Layoutdisplay (block, flex, grid, inline, inline-block, inline-flex), max-width, flex-direction, flex-wrap, justify-content, align-items
Otherbox-shadow, cursor (pointer, default, text), opacity, list-style-type

At-rules: only @media with min-width, max-width, prefers-color-scheme, prefers-reduced-motion or hover: hover.

Limits: 32 KB, 300 rules, 40 declarations per rule.

What is refused​

  • display: none, visibility, position, transform, overflow, clip, text-indent, pointer-events: anything that could hide or move content.
  • Text that is tiny, fully transparent or very faint, and sizes that are zero or negative.
  • url(), @import, @font-face, expression, behavior, javascript:, escapes and comments that hide any of these. Images come from the design's logo setting, not from CSS.
  • Any selector outside the .bmpc-* and [data-bmpc-*] hooks.

Security headers​

The hosted page is served with a Content-Security-Policy that allows scripts only from the page itself, no inline scripts, no plugins, no form posts elsewhere and no <base> changes. Images may come from any https: address, which is how your logo works. This applies on your own domain too.