Request: Theme config item type ="colorpicker"??
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Request: Theme config item type ="colorpicker"??
So, in my latest thread about theme colorsets I was wondering how a theme designer could continue to make theme customization easier.
I think user selected images, colorsets and user stylesheets are awesome. But as that thread explores loading styles directly into serendipity.css, I cannot help but imagine how nice it would be to have a theme config type of "colorpicker" (or something like that) where a theme designer could provide a default value - hex and/or rgb (or rgba?!) and the user could change the value using a color picker. This could be great for background colors, link colors, hover, etc..... super easy and no user stylesheet needed.
Something like this:
Thoughts? Anyone willing to take this on?
I think user selected images, colorsets and user stylesheets are awesome. But as that thread explores loading styles directly into serendipity.css, I cannot help but imagine how nice it would be to have a theme config type of "colorpicker" (or something like that) where a theme designer could provide a default value - hex and/or rgb (or rgba?!) and the user could change the value using a color picker. This could be great for background colors, link colors, hover, etc..... super easy and no user stylesheet needed.
Something like this:
Thoughts? Anyone willing to take this on?
=Don=
Re: Request: Theme config item type ="colorpicker"??
You might not want to hear this.Don Chambers wrote:Thoughts?
Technically, this would be fairly easy and cheap. HTML brings input[type="color"] which is supposed to be a native color picker in the browser. Unfortunately, browser support is, well, incomplete at best (no IE, no Edge, no Safari).
The alternative is to use a jQuery/JS plugin color picker. There are a ton out there, and they all have one thing in common: they come with a lot of baggage. You need some JS, some CSS and often some image assets. Personally, I feel that this would be quite a lot to latch on to the lean and clean s9y backend just to be able to pick colors, especially since colorsets are not the norm in themes.
YL
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Request: Theme config item type ="colorpicker"??
I'm not seeing anything that I would describe as "a lot of baggage"... first one I went to was this: https://github.com/EastDesire/jscolor/releases - extremely lean IMHO. and I didn't even dig deep, or look into jQuery... there are probably other, even better scripts out there.
And as far as the current state of themes, and colorsets "not being the norm"... I was not trying to suggest that colorsets become the norm. Merely that having something like colorpicker might be one more easy to use tool for users when customizing themes.
And as far as the current state of themes, and colorsets "not being the norm"... I was not trying to suggest that colorsets become the norm. Merely that having something like colorpicker might be one more easy to use tool for users when customizing themes.
=Don=
Re: Request: Theme config item type ="colorpicker"??
Yeah, that's the point where we don't agree. I don't see the point in making themes customizable in that way. I think it is way more satisfying to help the people that actually want to customize themes do that through the user.css than to give them more and more “fool-proof” interfaces. It's the whole “teach a man how to fish” thing.Don Chambers wrote:Merely that having something like colorpicker might be one more easy to use tool for users when customizing themes.
My point is: if this is implemented (especially as part of the core) please pick a solution as lean as possible. There are other solutions out there that require a lot more assets than the one you mentioned.
YL
Re: Request: Theme config item type ="colorpicker"??
Maybe input['color'] with a good description could already be enough? FF + Chrome should cover a lot of users, and the fallback in IE to a normal text input does not have to be horrible.
To add that would take ~5 lines of code.
To add that would take ~5 lines of code.
Re: Request: Theme config item type ="colorpicker"??
HUH... Who said thisyellowled wrote:... implemented (especially as part of the core) ...
IMHO a release zip delivered theme is not part of the core. It is just pre delivered because of license and easyness.
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: Request: Theme config item type ="colorpicker"??
I assumed that for this to be available as a theme option for themes, it would have to be part of the core (like – as far as I know – all the other input types available as theme options).Timbalu wrote:IMHO a release zip delivered theme is not part of the core. It is just pre delivered because of license and easyness.
YL
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Request: Theme config item type ="colorpicker"??
There are FAR fewer serendipity users to teach to fish than there were several years ago. I think providing easy ways for people to customize themes is not a bad idea. We give them easy ways to add images, even though we could force them to go through user.css.yellowled wrote: Yeah, that's the point where we don't agree. I don't see the point in making themes customizable in that way. I think it is way more satisfying to help the people that actually want to customize themes do that through the user.css than to give them more and more “fool-proof” interfaces. It's the whole “teach a man how to fish” thing.
We have other theme option types, I was merely suggesting that we explore the idea of a colorpicker that would allow a theme designer to offer color input for theme options. Body colors, link colors, header colors, whatever. Just thought it might be a nice feature if it was implemented in - as you said - a lean way.[/quote]
Perhaps we can start with Onli's "5 lines of code" approach and see what develops from there.
=Don=
Re: Request: Theme config item type ="colorpicker"??
I'll see now how easy that really is to do.
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Request: Theme config item type ="colorpicker"??
I am happy to help in anyway I can.onli wrote:I'll see now how easy that really is to do.
=Don=
Re: Request: Theme config item type ="colorpicker"??
I pushed it: https://github.com/s9y/Serendipity/comm ... 73b71b4723
Things left to do:
1. Make the button smaller (I did not want to mess too much with the css)
2. Test whether it works for you
3. Decide whether that needs a polyfill for IE, and if yes, add it
Also, given that this comes form colorsets, maybe it would be nice to combine that with a widget in which there are multiple colored squares, each defined by the theme author, to give a set of predefined colors to the colorpicker?
Ah, I forgot to show my example syntax:
Things left to do:
1. Make the button smaller (I did not want to mess too much with the css)
2. Test whether it works for you
3. Decide whether that needs a polyfill for IE, and if yes, add it
Also, given that this comes form colorsets, maybe it would be nice to combine that with a widget in which there are multiple colored squares, each defined by the theme author, to give a set of predefined colors to the colorpicker?
Ah, I forgot to show my example syntax:
Code: Select all
array(
'var' => 'infotwokcolor',
'name' => 'infotwokcolor',
'type' => 'color',
'default' => '#AAEEFF',
),
Re: Request: Theme config item type ="colorpicker"??
Must this really be in core? Isn't this possible as part of the theme only...?
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: Request: Theme config item type ="colorpicker"??
No. You need to have this in the core, this goes through serendipity_plugin_config, and reads the tpl plugin_config_item from the admin theme. Besides, it is good to have it.
The only thing we could change is to make it dynamically, to have a config item which is just a html5 input, and where the input type is changeable by plugin/theme. But this collides with how it was done till now, and some of our widgets are more complicated than that.
The only thing we could change is to make it dynamically, to have a config item which is just a html5 input, and where the input type is changeable by plugin/theme. But this collides with how it was done till now, and some of our widgets are more complicated than that.
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Request: Theme config item type ="colorpicker"??
Pretty cool - and just a few lines of code....
Here is what this looks like in 4 browsers on my Windows pc:
As expected, it doesn't work in IE... which, unfortunately, a lot of the world uses (even if a lot of s9y users don't).
I am also wondering how do we make a choice of "none"?
Here is what this looks like in 4 browsers on my Windows pc:
As expected, it doesn't work in IE... which, unfortunately, a lot of the world uses (even if a lot of s9y users don't).
I am also wondering how do we make a choice of "none"?
=Don=
Re: Request: Theme config item type ="colorpicker"??
Do we really need none? I mean, if it does not toggle new elements, those elements are there and have a color already. I rather think we'de need a way to set the default (maybe you meant that).
It always could be deactivable in a prior setting, but I don't like that.
It always could be deactivable in a prior setting, but I don't like that.