For the complete documentation index, see llms.txt. This page is also available as Markdown.

Accessible CSS customization

Didomi is not an accessibility expert and cannot provide specific accessibility advice. The non-exhaustive information on this page is for general awareness only and is intended to help you identify common issues and get started. For a reliable evaluation and remediation of accessibility concerns, please consult a qualified accessibility partner.

🎨 1. Color Contrast

❌ Poor Contrast Example

/* Low contrast between text and background */
.notice-text {
  color: #999;           /* Light grey */
  background-color: #fff; /* White */
}

Why it’s a problem: The contrast ratio is too low for normal text (less than 4.5:1), making it hard to read for many users.

✅ Accessible Alternative

/* High contrast pairing */
.notice-text {
  color: #1a1a1a;           /* Near-black */
  background-color: #ffffff; /* White */
}

Tip: Use a contrast checker to test before applying.


⌨️ 2. Focus Styles

❌ Bad: Focus Indicator Removed

Why it’s a problem: Removes the visual cue for users navigating with a keyboard.

✅ Good: Custom Focus Indicator

Optional: Use brand colors, but make sure the focus ring is always visible.


🧭 3. Button Styling

❌ Non-semantic Element

Why it’s a problem: <div> isn’t a semantic button—screen readers and keyboard users can’t activate it by default.

✅ Accessible Alternative

Or if a custom element is required:


🧪 4. Avoid Content That Is Only Visible on Hover

❌ Tooltip on Hover Only

Why it’s a problem: Touchscreen users or keyboard users can’t hover.

✅ Accessible Tooltip (visible on focus too)


📱 5. Responsive Text

❌ Fixed Text Size

✅ Scalable Text

Last updated