2015-12-31, 23:02:12
(2015-12-31, 16:31:18)Arugula Wrote: Great idea for a plugin! But question/suggestion:
Is it possible to skip the schema? I'd like to offer the user to choose ANY color they want, rather than my small list of color combinations. Example: I'd use @backgroundColor in LESS, and then have a text input field in settings.php that allows user to enter in any 6-digit hex number for it that they wish. They could get that hex number from one of many online color choosing tools. (Although, even better, a color chooser could be incorporated into the settings.php??).
But what function/code would I need to create that text input field in settings.php to allow user to enter a color hex number?
You can specify any fields in the settings.php.
To combine extra fields specified in settings.php, but not in the *.properties (e.g. provide a template, but let the user specify the link color), use something like this:
Code:
<?php
$additional = array('f1' => return_theme_setting('f1'), 'f2' => return_theme_setting('f2'));
get_less_css('default.less', return_theme_settings($additional));
?>
If you don't have schemas, remove the schema select from settings.php and make sure you have a empty default.properties.
You could then also create the css like this (but the above code would still work):
Code:
<?php
$additional = array('f1' => return_theme_setting('f1'), 'f2' => return_theme_setting('f2'));
get_less_css('default.less', $additional);
?>