How this could work. In the administrative console user comes into
section Themes, opens a theme on Edit. If the theme supposes fast
automatic change there will be one more tab "Parameters". On this tab
user can change theme's parameters. In the elementary case there will
be enough three parameters:
1) primary color of a background
2) primary color of the text
3) the basic type of a font (Arial, Times etc.)
Having set these parametres user can press button "Apply" - thus it
will be automatically changed style.css and other files which are
necessary for changing for conformity of a theme to new parametres.
How this can be developed. In case the theme supports such automated
change, theme's files should contain the information on that what
parameters a theme accepts also what files should change
automatically. I suggest to make in such themes the "parametres"
folder, where to place
1) CSV a file parameters.csv with fields
1.1) "Name" - a parameter name, for example "BackgroundColor",
1.2) "Default" - value of a variable by default, that follows to
generation of a standard theme
1.3) "Value" - the value entered at last change of a theme
2) to Each file which should be changed at theme change, there should
correspond a file in the "parameters" folder.
2.1) For example if it is necessary to change a file style.css there
should be a file parameters/inc/style.css in which color constants and
names of fonts are replaced by a code designating what variable it is
necessary to substitute.
2.2) If a theme contains color images which should correspond to the
choosen color parametres, them it is possible automatically generate.
For example, if there will be a file parameters/inc/blue_line.gif it
is possible at automatic change of a theme on the basis of this file,
preset values of color parameters and default values of color
parameters in a theme generate a file inc/blue_line.gif where color of
each pixel will be calculated under the formula. It probably to make
with GD library (functions imagecolorset, imagecolorat).
Actual variables count can be greater than parameters entered by the
user. For example, complementary colors can be calculated
automatically, as proportional to components of base colors of a
background and the text. For example, color of headings may be taken
as 20 % shift colour component's of primary colour of the text towards
primary color of a background.
Probably, it is necessary to store in the "parameters" folder also
last versions of automatically changed files to warn the user changed
files directly about possible loss of changes in result of automatic
theme generation.
I was thinking to post this kind of idea when I saw yours, and I'd
like to participate here.
My thought, as I customize themes evryday, would be to have a simple
page, where we prompt users, in natural language, about size, colors
and background of each element used in in-portal advanced theme. This
would be an easy way to modify CSS without any knowledge, and maybe
even faster than seeking for properties spread accross styles and
dmenu css files.
To join your idea, we could have this 'tuning file' in a special
directory of the theme, and each new theme could have this feature.
I'd like to prepare and example, but time is missing this month, I
hope I'll be able to provide an example soon.
What do you think guys?
Phil.