Problem/Motivation
Originally from #3236324: Move environment definition UI and color module dependency from environment_indicator to environment_indicator_ui
As of #3270899: Remove Color module from core we should discuss if a simple HTML5 color picker form element isn't the better and more lightweight solution, especially for a module which is more or less developer focused. With #3236324: Move environment definition UI and color module dependency from environment_indicator to environment_indicator_ui the dependency on color module becomes even more heavy.
Steps to reproduce
Proposed resolution
Use native HTML5 <input type="color" value="#123456"> instead of color module picker.
You can try it here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color
The selector is determined by the browser and OS. For Chrome on Windows it looks like this:
We should also keep in mind, that this is not an "End-user" feature, but a site manager / administrator task. Typically they will have technical knowledge.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | standalone-color-picker.png | 125.52 KB | akalam |
| #4 | html-color-picker-chrome.JPG | 50.12 KB | anybody |
| #3 | html-color-picker-chrome.JPG | 50.12 KB | anybody |
Issue fork environment_indicator-3284389
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joelpittetThis could use some screenshots of what the HTMl5 color picker vs the color module's (I believe farbtastic IIRC) color picker looks like to help compare.
Comment #3
anybodyComment #4
anybodyComment #6
akalam commentedColor module doesn't look to be needed. Here is MR without the color module dependency. In fact, the "color" render element that environment_indicator is using for forms is part of core (not color module) https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/lib/Drupal/C...
Here is a screenshot where you can see how it looks like with the dependency removed and the color module uninstalled.
Comment #8
joelpittetSweet thanks @akalam, let's remove it!
Comment #11
e0ipsoThanks all for the contribution!
Comment #12
anybodyVery cool, thank you all! :)