Allow three character hex color definitions in Olivero settings

Created on 23 October 2023, about 1 year ago
Updated 25 January 2024, 12 months ago

Problem/Motivation

Whilst looking to implement config validation for Olivero's config schema, it was noticed that the Olivero theme and the Image module were validating hex colours differently; Image allows three character definitions, whereas Olivero does not.

Steps to reproduce

Verify Image allows three character hex codes by creating a new image style, adding a Rotate effect and setting the background colour to a 3 character code:

Verify Olivero does not accept three character hex codes by going to /admin/appearance/settings/olivero and attempting to save the theme configuration with a primary base color with a three character code.

Proposed resolution

Use Drupal\Component\Utility\Color::validateHex() to validate hex codes in Olivero rather than the existing custom regex.
Do whatever is then needed (if anything) to make Olivero work with such codes.

Remaining tasks

All the things.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD

✨ Feature request
Status

Fixed

Version

11.0 🔥

Component
Olivero  →

Last updated 5 days ago

Created by

🇬🇧United Kingdom Eli-T Manchester

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024