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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

nod_’s picture

Issue tags: -farbtastic +JavaScript
Anonymous’s picture

Here'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.

Anonymous’s picture

Status: Active » Needs review
Anonymous’s picture

Argh, the patch didn't attach...

markhalliwell’s picture

Issue summary: View changes
Issue tags: +Needs manual testing, +Needs screenshots
nod_’s picture

Small update, the color were not updating properly. I so want to rip everything apart but it's not the time or place :p

Status: Needs review » Needs work

The last submitted patch, 7: core-js-color-farb-2268955-7.patch, failed testing.

nod_’s picture

Status: Needs work » Needs review
FileSize
45.9 KB
2.34 KB

Status: Needs review » Needs work

The last submitted patch, 9: core-js-color-farb-2268955-9.patch, failed testing.

nod_’s picture

Assigned: » Unassigned
FileSize
518 bytes
46.13 KB
nod_’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: core-js-color-farb-2268955-11.patch, failed testing.

mgifford’s picture

Issue tags: +Needs reroll

What happened to ColorConfigSchemaTest.php, ColorTest.php & JavaScriptTest.php?

rakhimandhania’s picture

Status: Needs work » Needs review
Issue tags: +#drupalgoa2015
FileSize
130.62 KB

Re-rolled the patch and uploading the updated patch.

Status: Needs review » Needs work

The last submitted patch, 16: core-js-color-farb-2268955-16.patch, failed testing.

piyuesh23’s picture

markhalliwell’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Needs work » Postponed
Issue tags: -#drupalgoa2015

This 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.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Dom.’s picture

Issue tags: -JavaScript +JavaScript

I 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.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nod_’s picture

Title: Remove farbtastic library » Deprecate farbtastic library
Status: Postponed » Needs work
Issue tags: -Needs manual testing, -Needs screenshots, -Needs reroll
nod_’s picture

Status: Needs work » Closed (duplicate)

Closing this one in favor of #1651344: Use color input type in the color.module, contrib credit ported to the other issue.