Skip to content

Conversation

@bennothommo
Copy link
Member

@bennothommo bennothommo commented Sep 27, 2021

This PR introduces a newly redesigned color picker widget, built on top of the Pickr UI widget as opposed to Spectrum, which has not seen a release since 2016.

image

Benefits

New config options

Option Description
formats Specifies the color format(s) to store. Can be a string or an array of values cmyk, hex, hsl and rgb. Specifying all as a string will allow all formats. Defaults to hex.
allowCustom If false, only the colors specified in availableColors will be available for selection. The color picker palette will be disabled. Default true.

Notes

  • Given that we've dropped support for IE11 in the Backend, I've used some ES6 code (just arrow functions, really) to resolve some scoping issues in the JS, and the picker itself uses CSS Grid Layout. Both features, AFAICT, have been supported by all browser versions within the last 4-5 years, so I don't think we're leaving anyone behind with this.
  • This should be fully compatible with values from the old color picker, since they would've been stored as hex values. I also believe that it should be able to convert any value to another format if someone opts to change the format in the config, but I have not tested this yet.
  • I'll post up a video of this tomorrow, but feel free to have a play around with it on Gitpod in the mean time. Go to Settings > Customize back-end > Colors to get a couple of color picker widgets to play with.

@bennothommo bennothommo added enhancement PRs that implement a new feature or substantial change Status: Testing Needed needs review Issues/PRs that require a review from a maintainer labels Sep 27, 2021
@bennothommo bennothommo added this to the v1.1.7 milestone Sep 27, 2021
@LukeTowers
Copy link
Member

Something seems off about the font, is that the default font? Maybe we should use a mono space font instead

@bennothommo
Copy link
Member Author

@LukeTowers yeah it's the default body font. I'll change it to monospace.

@LukeTowers
Copy link
Member

Could we also provide format: any to allow the user to pick which format they want to use?

@bennothommo
Copy link
Member Author

@LukeTowers multiple format support has been added.

@LukeTowers
Copy link
Member

Is there a docs PR for the changes?

@bennothommo
Copy link
Member Author

@LukeTowers not yet - I'll put one through shortly. Any further thoughts on this, as it is ready to merge?

@bennothommo bennothommo removed Status: Testing Needed needs review Issues/PRs that require a review from a maintainer labels Oct 12, 2021
bennothommo added a commit to wintercms/docs that referenced this pull request Oct 12, 2021
@bennothommo bennothommo merged commit 6a2f234 into develop Oct 25, 2021
@bennothommo bennothommo deleted the wip/colorpicker-rewrite branch October 25, 2021 03:19
bennothommo added a commit to wintercms/docs that referenced this pull request Oct 25, 2021
LukeTowers added a commit that referenced this pull request Nov 13, 2021
* develop: (25 commits)
  Support embedded data URIs in the list image column type
  Make some adjustments to the readme content
  Update banner in readme
  Add new GitHub banner
  Documentation with icons (#347)
  Limit options shown in group filter, apply scope when retrieving filtered options
  Add Exception on wrong relation type in relation formwidget (#334)
  Redesigned color picker widget (#324)
  Add winter:test command (#202)
  Use the correct backend timezone config key (#337)
  Get changelog only of the current branch
  Fix Markdown editor sizing issue on Chrome.
  Check overrides for parent locale when compiling language files (#242)
  Fixing commas in English translation files (#305)
  Added Latvian translations for Allowed IP messages (#304)
  Add missing filter translations (#303)
  Clean up newlines
  Update Russian language (#302)
  Fix issue present in overriding RelationController partials using the default code
  Maintenance Allowed IP list (#147)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that implement a new feature or substantial change

Projects

None yet

4 participants