pickr
pickr copied to clipboard
Custom template
Hi,
First of all this library is super cool :+1:
Im wondering is there anyway I can use custom template or modify existing template. I see there is a static method createFromTemplate
to create, but however I'm not sure how to use.
When I checked the source for createFromTemplate it seems fixed.
Any thoughts?
As you said, you can clone it and modify createFromTemplate
. It's basically documented here but ask if you have any questions regarding to it.
Unfortunately there's currently no other method to change it except in the source code. Moreover I'd have no idea how to add a reasonable option to modify it. Any idea is welcome 😄
In my case, the picker should have vertical view. So I acheived this by modifying SCSS and pointer lock properties.
Also, I am trying to replicate something like this with a small preview icon,
Let me see, if I can make it as a generic solution ( by having additional settings for different view ).
@lokesh-coder Pickr got themes where the one you tried to implement is now available as nano theme, check out the demo :)
I also noticed this project which had a Chrome'ish color picker look https://narsenico.github.io/a-color-picker/ Maybe it would also be possible via a config option, theme or template to choose if the HEXA/RGBA/HSLA values should be splitted into separate input fields or as it is in the current version?
@bjarnef That's currently not possible, you would need to manipulate the template :( But I like the Borderlines hue-picker, maybe I'll update the nano layout more in this direction :)
Edit, the nano theme is now more... nano :)
@Simonwep okay, maybe it would be possible in a future version to specify a custom template (from config or a path to e.g. a html view/template) and maybe an option to split the values in separate input fields. Anyway I really like the current version. Keep up the good work 👍
Maybe the published theme styles should be moved to a separate folder themes
in this folder
https://github.com/Simonwep/pickr/tree/master/dist like in the source folder https://github.com/Simonwep/pickr/tree/master/src/scss/themes ?
@bjarnef Thanks :) Yea I'll work on such a feature since It would allow to create anything out of it. To your second point, yeah - that's a good idea :D