pickr icon indicating copy to clipboard operation
pickr copied to clipboard

Custom template

Open lokesh-coder opened this issue 6 years ago • 7 comments

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?

lokesh-coder avatar Nov 03 '18 17:11 lokesh-coder

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 😄

simonwep avatar Nov 04 '18 18:11 simonwep

In my case, the picker should have vertical view. So I acheived this by modifying SCSS and pointer lock properties.

image

Also, I am trying to replicate something like this with a small preview icon,

image

Let me see, if I can make it as a generic solution ( by having additional settings for different view ).

lokesh-coder avatar Nov 05 '18 15:11 lokesh-coder

@lokesh-coder Pickr got themes where the one you tried to implement is now available as nano theme, check out the demo :)

simonwep avatar Jun 14 '19 18:06 simonwep

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 avatar Jun 14 '19 21:06 bjarnef

@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 :) alt

simonwep avatar Jun 16 '19 09:06 simonwep

@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 avatar Jun 16 '19 20:06 bjarnef

@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

simonwep avatar Jun 20 '19 12:06 simonwep