Openli
IntroductionGetting StartedTechnical DocumentationGet help
  • Getting started
    • Introduction
    • Dictionary
    • FAQ
      • IAB TCF v2.0
  • Privacy hub
    • How to create your privacy profile
    • How can I get an Openli Privacy Badge?
    • Vendor owners
    • Why are custom properties on vendors super valuable?
    • Setting up custom properties
  • Cookie Consent Management
    • Quickstart
    • Checklist: Cookies
    • Cookie widget
      • Create a cookie policy
      • Create a cookie widget
      • Install the widget
      • Manually add any cookies
      • Customise your widget
      • How to get color codes
      • Set the widget language
      • Use custom link/button instead of Cookie Shield
      • Add company name to cookie pop-up
    • Categorise your cookies
    • Adding information to cookies
    • Adding information to your cookie providers
    • Blocking Cookies with Openli
    • Cookie expiration dates and lifespan
      • Changing expiration on Google Analytics cookies
  • Policy and agreement management
    • Generate your privacy policy
    • Changing an old cookie policy to a new on autopilot
    • Embed your policies and legal agreements
      • Embedding agreements without displaying a widget
    • Install the Privacy Badge
  • General Openli guides
    • Setting up SSO (Single Sign-On)
      • SSO with Azure AD (Microsoft)
      • SSO with Google
      • SSO with Okta
      • How to log in with SSO
    • Add a website to your Openli account
    • Using projects to handle multiple languages
    • Collect consents without storing IP addresses or user-agents
  • Technical documentation
    • Widget
      • Collect cookie consent
        • Blocking cookies
        • Blocking embedded media
        • Cookie-widget options
        • Consent state API
    • API
      • Services
        • Personal data
        • Subprocessors
    • Cookies set by Openli
  • System Specific Integration Guides
    • Cloudflare
  • Legacy integrations
    • Google Consent Mode
    • Google Tag Manager
      • Block cookies with GTM
      • Install Openli with GTM
      • Prevent triggers from firing in GTM
    • HubSpot
    • Pardot
    • Shopify
      • Install cookie widget
      • Integrate consent with checkout
    • Square Online
    • Squarespace
    • Webflow
    • Wix
Powered by GitBook
On this page
  • General color inheritance
  • Font-sizing and line-spacing
  • Styling the border and checkmark of our checkboxes
  • Styling error-related text
  • Styling the asterisk on required fields
  1. Technical documentation
  2. Widget
  3. Collect consent

CSS styling options

Here is a detailed guide for how to style various aspects of the consent collecting widget.

Last updated 5 years ago

General color inheritance

The text in our widget inherits the color value from higher up in the cascade. This will default to black or what the default value set by the browser is, if a specific value is not defined. This will apply to all elements except when an error occurs. Error-related text will use our default error-color.

If your styles are not applied as you expect, it is likely due to the selector specificity not being high enough. Increasing the specificity will make your styles be applied, instead of our default ones. The following resources cover this in more detail: and the .

Font-sizing and line-spacing

You are able to control the font-sizing and line-spacing of our widget. In practice, our widget inherits both font-sizing and line-spacing higher up in the cascade if defined. If no values are defined for font-sizing and line-spacing, both will use our default values.

Styling the border and checkmark of our checkboxes

You can style the border-color of the checkboxes and the color of the checkmark in our widget. To do this, add rules like the following to your stylesheet:

.lm-base .lm-checkbox {
    /* set the color of the checkbox border */
	border-color: #abc123;	
}

.lm-base .lm-checkbox::after {
    /* set the color of the checkmark; inherits from checkbox border if not specified */
    border-color: #abc123;
}

You are free to choose if you want to control both the border-color and checkmark color. If you do not set a value, both will default to use our standard border-color.

Styling error-related text

To change the color of error-related text in the widget, add a rule like this to your stylesheet:

.lm-base .lm-error {
    /* set the color of error-related text, and of invalid/unchecked required fields */
    color: #abc123;
}

Styling the asterisk on required fields

If you have set the markRequiredFields: true option in legal.widget() , you can style the color of the asterisks that are shown after required fields. Add the following rule to your stylesheet:

.lm-base .lm-required-field {
    /* set the color of the asterisks shown after required fields */
    color: #abc123;
}

If you do not specify a color, it will be inherited from our default error-color. If you have overridden that, your specified error-color will be used.

CSS Specificity (MDN)
"Specifishity" cheat-sheet