Use color input type in the color.module

Created on 22 June 2012, over 12 years ago
Updated 22 February 2024, 7 months ago

Problem/Motivation

Drupal has shipped with the Farbtastic library since Garland was added in 2006 to allow users to select colors from a color picker in themes.

Nowadays, the "color" HTML input type is widely supported in all major browsers except IE11 (https://caniuse.com/?search=color) and provides a preferred native UI/UX for this functionality.

Proposed resolution

Use the "color" input type in color.module.

Remaining tasks

  • Deprecate Farbtastic?

User interface changes

The color picker in color.module will be replaced with a native UI, except in IE11 where colors can only be entered by hex code.

API changes

Data model changes

Release notes snippet

The color picker used in theme settings has been replaced with the native browser widget.

Related Issues

Original report by @nod_

Works well on FF, Opera. Chrome implementation of the color widget is messed up, hopefully they will fix it.

Providing a patch to allow testing from other people and hopefully come up with a proper strategy for weird browsers. Color input type is kinda the bleeding edge, we'll get cut.

The js in itself needs quite some work, but outside the scope of this issue.

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇫🇷France nod_ Lille

Live updates comments and jobs are added and updated live.
  • Needs release manager review

    It is used to alert the release manager core committer(s) that an issue significantly affects the overall technical debt or release timeline of Drupal, and their signoff is needed. See the governance policy draft for more information.

  • JavaScript

    Affects the content, performance, or handling of Javascript.

  • Needs accessibility review

    Used to alert the accessibility topic maintainer(s) that an issue significantly affects (or has the potential to affect) the accessibility of Drupal, and their signoff is needed (see the governance policy draft for more information). Useful links: Drupal's accessibility standards, the Drupal Core accessibility gate.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    The parent issue is in core and that doesn't really makes sense since this is in contrib. Moving that parent to related to help retain the history.

Production build 0.71.5 2024