Feature request - Additional customization options

Permalink
Right now I'm building a new theme, and I'm making use of CSS3 gradients. I'd like to let the user pick two colours from the customization page and have elements that use the gradients, update. For example, if my code looks like this:

/* For use with Safari 5.1, Chrome 10+ */
  background: -webkit-linear-gradient(top, /* customize_nav-hover-1 */ #ffe983 /* customize_nav-hover-1 */ , /* customize_nav-hover-2 */  #e4be5d /* customize_nav-hover-2 */ );


I expect to see two customization colour pickers. One called Nav Hover 1 and the other, Nav Hover 2. Instead I get neither, as C5.5.1 (and older versions too) only display the customization if it is a background-color or color property. I'd like to see C5 expanded to show the colour picker for any property, as long as it has # or RGBA in it, for example:

.myclass {
  background: /* customize_my-colour */ #FF0000 /* customize_my-colour */ url(images/blah.jpg) repeat-x;
  color: /* customize_another-colour */ rgba(255,0,0,0) /* customize_another-colour */


would both be valid and show up in the customization box.

I'd also like to see the theme system updated to allow customization of non-font and non-colour properties. For example:

.myclass {
  margin-top: /* customize_my-margin */ 25px /* customize_my-margin */


would display a textbox called My Margin, as it's neither a colour or font. I know there is a section for additional CSS, but having textboxes would make it easy for non-CSS minded people to play with values.

When I get some time, I may experiment with the idea (if I can find where the code for theme customization is. Perhaps after sleep!), but what are your thoughts?

Grayda
 
Mainio replied on at Permalink Reply
Mainio
Yes, this seems to be hard-coded on when to show up the font selector and when the color picker. It depends on the css-definition as stated in /concrete/models/page_theme.php, PageTheme::getEditableStyleType().

I hardly ever use the stylesheet customization functionality (mainly because I'm not a theme developer and I hardly ever develop general-level themes that need to be customizable), so I probably don't require such functionality myself but if you want to take a closer look on the issue, here's the methods you should check out, both in /concrete/models/page_theme.php:
- PageTheme::parseStyleSheet()
- PageTheme::getEditableStylesList()
- PageTheme::getEditableStyleType()

Depends on your approach what you need to modify, so I'll leave that for you. Hopefully you'll get a good start with this information!

Antti / Mainio
Grayda replied on at Permalink Reply
Grayda
Thanks for the tip! I've been playing around for a bit today and have got C5 to recognize and output any styles that have a hex colour attached to it. In my test case:

.mystyle {
  background: /* customize_cool-colour */ #FF0000 /* customize_cool-colour */ ;
}


seems to work. Only catch is, after the stylesheet is parsed and outputted, anything after the #FF0000; isn't added (on that line).

Once I fix that up, I might upload a PHP file so others can take a look. It just drops right into the /models folder so it's pretty elegant to deploy.
queesamor replied on at Permalink Reply
queesamor
Did you ever get this working?