Problem/Motivation
- We (Drupal/@RobLoach) has essentially taken over the Farbtastic repo so it would comply with our standards and fix bugs that creeped up because of 8.x changes.
- Farbtastic is outdated and no longer (officially) maintained: #481682-7: Decide what to do with Farbtastic library.
- Farbtastic has little/no mobile support.
- Ultimately, we are going in an entirely different direction and this certainly facilitates this direction (without Farbtastic): #445990-24: [META] Refactor color module (screenshots are outdated, but the concept remains the same).
Proposed resolution
Remove Farbtastic from core.
Remaining tasks
Create patch- Manually test
- Take screenshots
User interface changes
- Removes the color wheel "color picker" in a theme's settings pages.
- Removes the "lock" icons (relies on Farbtastic's HSL method to keep the correct hue).
API changes
Not really an API change per se, but contrib modules will no longer have the ability to rely on the availability of this library and will have to install it manually if it is needed.
Original report by @JamesLefrère
Since farbtastic is not being maintained anymore and input type="color" is gaining support, I suggest removing the library and falling back to a validated text input field. This issue is just about removing the library; I'm in the process of replacing the necessary js to perform the same behaviour without the library, which seems simple enough, but the problem is that farbtastic is used as a handy example for various tests and API examples:
system/system.api.php
- hook_library_info_alter
core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
- testLibraryRender
- testLibraryAlter
- testLibraryNameConflicts
- testAttachedLibrary
- testGetLibrary
None of the other libraries have JS and CSS, but I could switch them to underscore (for example) to test the rest.
Comment | File | Size | Author |
---|---|---|---|
#18 | remove_farbtastic_library-2268955-18.patch | 129.68 KB | piyuesh23 |
#16 | core-js-color-farb-2268955-16.patch | 130.62 KB | rakhimandhania |
#11 | core-js-color-farb-2268955-11.patch | 46.13 KB | nod_ |
#11 | interdiff.txt | 518 bytes | nod_ |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
nod_Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedHere's a patch.
Ultimately, without farbtastic or a similar library, the functionality of this module has to be simplified. Does anybody currently use the locking and hue wheel features? Looking at https://drupal.org/node/1166078, I think it could be more usable with just simple, individual colour pickers.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedArgh, the patch didn't attach...
Comment #6
markhalliwellComment #7
nod_Small update, the color were not updating properly. I so want to rip everything apart but it's not the time or place :p
Comment #9
nod_Comment #11
nod_Comment #12
nod_Comment #15
mgiffordWhat happened to ColorConfigSchemaTest.php, ColorTest.php & JavaScriptTest.php?
Comment #16
rakhimandhania CreditAttribution: rakhimandhania commentedRe-rolled the patch and uploading the updated patch.
Comment #18
piyuesh23 CreditAttribution: piyuesh23 commentedComment #19
markhalliwellThis issue really needs to wait until #1651344: Use color input type in the color.module is implemented, which is also currently postponed until 8.1.x (mainly due to lack of global browser support at the moment... although it is rising, just slowly). Removing an actual "feature" seems a bit drastic for while in beta as well.
Comment #29
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedI fill the color type from form API harder to use from a UX perspective. However if I choosed to use farbtastic in my modules admin, it is because even if a color type is not required, I can't have no value entered in a
'#type' => 'color'
field. Before removing the farbtastic library from core, I think it should be made something so you can clear a color field.Comment #32
nod_Comment #33
nod_Closing this one in favor of #1651344: Use color input type in the color.module, contrib credit ported to the other issue.