Skip to content

SuiteCRM theme contrast: the colour pairs to check for WCAG AA

A custom SuiteCRM theme has 26 text and background pairs that must reach 4.5:1 for WCAG AA. Every pair, the defaults that fail, and how to fix a failing colour.

Updated · By Muhammad Ilyas, Techholds

What contrast does a SuiteCRM theme need for WCAG AA?

A SuiteCRM theme needs a contrast ratio of at least 4.5:1 between normal text and its background to meet WCAG 2.2 Level AA. In a SuiteP-based theme that applies to 26 text and background pairs, including navbar text, tab labels, list headers and five kinds of button label. Stock Dawn's default button label measures only about 2.3:1.

The rule

Contrast ratio compares the relative luminance of two colours, from 1:1 (identical) to 21:1 (black on white). WCAG 2.2 success criterion 1.4.3 sets 4.5:1 as the minimum for normal text at Level AA. Almost all CRM interface text is normal size, so 4.5:1 is the number to hold every pair to.

In a CRM this matters more than on a website. Staff read the same screens for hours, often on uncalibrated office monitors, and a brand colour that looks fine in a logo can make a navigation bar unreadable once white or grey text sits on it.

Every pair to check in a SuiteCRM theme

These are the text and background combinations a SuiteP theme (SuiteCRM 7, and the classic views of SuiteCRM 8) actually draws. Check each one with any WCAG contrast checker:

WhereText on background
Top navigation barMenu text on the navbar background
Top navigation menuMenu text on the drop-down menu background
Current module tabHighlighted tab label on the menu background
Global searchSearch text on the search box background
Quick-create (+) buttonIcon on the quick-create background
Notification badgeCount on the alert badge background
SidebarSection heading on the sidebar background
Sidebar buttonsButton label on the sidebar button
Detail view tabsActive tab label on the active tab
Detail view tabsInactive tab label on the inactive tab
Actions buttonLabel on the actions button
List viewColumn headings on the header row
List view toolbarPagination text on the toolbar (7.12 and later)
List view toolbarSelected-record count on the toolbar
Bulk action menuMenu items on the action menu
Bulk action menu (7.10 and 7.11)Button-coloured items on the action menu
PanelsBody text on the panel background
PanelsLinks on the panel background
Panel headingsHeading text on an expanded panel
Panel headingsHeading text on a collapsed panel
FormsSelected option text on the select background
Default buttonsLabel on the default button
Primary buttonsLabel on the primary button
Danger buttonsLabel on the delete/danger button
Success buttonsLabel on the success button
Info buttonsLabel on the info button

Where brand colours usually fail

  • Button labels. In SuiteP the primary, danger, success and info buttons all take their label colour from one variable, $default-btn-color, rather than each choosing white or black. Make the primary button your light brand colour and its label can drop well below 4.5:1 while the others look fine.
  • The stock defaults. Dawn's own default button label, #f5f5f5 on #94a6b5, is about 2.3:1. Starting from Dawn does not mean starting from a passing theme.
  • Mid-tone navbars. Medium blues, greens and oranges sit in the band where neither white nor dark text reaches 4.5:1. Darken the navbar a step, or switch the text colour.
  • Hover states. A colour that passes at rest can fail on hover. Check the hover colour against the background it actually sits on.

Fixing a colour that fails

  1. Keep the hue, change the lightness. Darken the background (or lighten it, for dark text) in small steps until the pair passes; the colour still reads as your brand.
  2. Flip the text colour. If dark text passes where white does not, use dark text on that surface.
  3. Recheck every pair the change touches. One background usually carries several text colours, so fixing one pair can break another.

Brandtint does this automatically: it adjusts colours pair by pair until every enforced pair passes 4.5:1, and shows you the worst ratio on the page before you download. Over 2,000 random test schemes, none finished with a failing pair. See it on your own logo.

Questions

What contrast ratio does WCAG AA require?

At least 4.5:1 for normal text and 3:1 for large text (about 18pt, or 14pt bold) under WCAG 2.2 success criterion 1.4.3. CRM interface text is almost all normal size, so 4.5:1 is the working rule.

Do the stock SuiteCRM themes pass WCAG AA?

Not on every pair. Stock Dawn's default button label, #f5f5f5 on #94a6b5, measures about 2.3:1, well below the 4.5:1 AA minimum.

Does SuiteCRM 8 need the same checks?

Its classic views (Admin, Studio and most record views) are drawn by a renamed SuiteP, so the same pairs apply there. The Angular screens have their own stylesheet and need their navigation, list and button colours checked too.

About the author

Muhammad Ilyas builds Brandtint at Techholds, including the SuiteCRM 7 and SuiteCRM 8 theme packages these guides are written from. Muhammad Ilyas on LinkedIn

Skip the SCSS. Start from your logo.

Brand your theme