This module lets you change the background color of the Drupal admin toolbar. You can pick a new color using a simple configuration interface for a more personalized look.
Introduction
Admin Toolbar BG Color changes the background and text colors of the Drupal admin toolbar. Give each site or
environment its own toolbar color, or give roles their own colors, so you can tell at a glance whether you are on
production or a test site, and who you are logged in as.
Project Summary
Color the admin toolbar per site, environment or role, with readable text chosen for you.
Features
- Choose the toolbar background color with a color picker.
- Readable text automatically: black or white, whichever has the most contrast with the background. Or choose your own text color, with a warning when its contrast is below the WCAG recommendation of 4.5:1.
- Colors per role, for example a red toolbar for administrators and a blue one for editors.
- A different color on each environment, set in settings.php. The settings page shows which settings are overridden.
- Turn the custom colors off without uninstalling the module.
- Only loads for users who can see the toolbar, and is cache-aware: color changes show straight away.
- Works with sites that use a strict Content Security Policy.
- Works with Admin Toolbar.
Post-Installation
- Grant the Administer Admin Toolbar BG Color permission to the roles that may choose the colors.
- Go to Configuration → System → Admin Toolbar BG Color (
/admin/config/administration/at-bgcolor). - Check Use custom toolbar colors, choose a background color, and optionally a text color and colors per role.
- To use a different color on each environment, override the settings in that environment's settings.php:
$config['admintoolbar_bgcolor.settings']['enabled'] = TRUE; $config['admintoolbar_bgcolor.settings']['admintoolbar_bgcolor'] = '#b3261e';
Additional Requirements
- Drupal 10.3+ or 11
- The core Toolbar module
No contributed modules or external libraries are required. The core Navigation module is not supported.
Similar projects
Environment Indicator labels and colors the
toolbar per environment, based on hostnames or Git branches. Admin Toolbar BG Color is deliberately simpler: one
settings page, colors per role, readable text chosen for you, and per-environment colors through standard config
overrides.
Supporting this Module
Bug reports, feature requests, patches, and documentation improvements are welcome through the Drupal.org issue
queue.
Community Documentation
Documentation is available in the project repository's README.
Upgrading
Run drush updb after updating. The update keeps your color, adds the new settings, and grants the new
Administer Admin Toolbar BG Color permission to every role that had Administer site
configuration. The text color is now chosen automatically, so light backgrounds get dark text; choose
Custom to pick your own. The module no longer depends on Color Field.
Permissions
- Administer Admin Toolbar BG Color (restricted) – choose the toolbar colors.
- Colors are shown to users with the core Use the toolbar permission.
The module is fully compatible with Drupal 11.
Ask your assistant about Admin Toolbar BG Color
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- toolbar Drupal core
- user Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.