Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
REQUEST: Refinement Themes & Styles (add VARIATION)
TomTester
New
PROBLEM
I wish there were a method similar to the conf/language 'overrides' to allow for simple
'theme & style' overrides to the default theme (or any theme for that matter).
SUGGESTION
How about adding another level called 'VARIATION' which redefines some of the underlying
base style, but none of the main structure.
BENEFITS
Style developers can create multiple variations on one base style (think colors, widths,
fonts etc., see example below)
'Style' add-ons that aren't actually much more than color variations on the default template, such
as Vanilla Greeen, no longer require a full 'clone' of default vanilla.css and can simply be defined
as 'VARIATIONS' instead. This means 'less porting' of changes to the release-version of
vanilla.css files to default-derived styles.
IMPLEMENTATION
CSS is already 'cascading' , hence it should not be difficult to implement: we merely include the
CSS VARIATION code as the last CSS link in the header.
USER INTERFACE
User interface-wise we expand the drop-downs with one more (VARIATIONS), e.g.
PS: if in the example above rightpanel were selected as a variation, the page HEADER would simply read:
I wish there were a method similar to the conf/language 'overrides' to allow for simple
'theme & style' overrides to the default theme (or any theme for that matter).
SUGGESTION
How about adding another level called 'VARIATION' which redefines some of the underlying
base style, but none of the main structure.
BENEFITS
Style developers can create multiple variations on one base style (think colors, widths,
fonts etc., see example below)
'Style' add-ons that aren't actually much more than color variations on the default template, such
as Vanilla Greeen, no longer require a full 'clone' of default vanilla.css and can simply be defined
as 'VARIATIONS' instead. This means 'less porting' of changes to the release-version of
vanilla.css files to default-derived styles.
IMPLEMENTATION
CSS is already 'cascading' , hence it should not be difficult to implement: we merely include the
CSS VARIATION code as the last CSS link in the header.
USER INTERFACE
User interface-wise we expand the drop-downs with one more (VARIATIONS), e.g.
THEME:Tom
VANILLA
STYLE:
DEFAULT
VARIATION:
DEFAULT (LIQUID LEFTPANEL)
LIQLP (LIQUID - LEFTPANEL)
LIQRP (LIQUID - RIGHTPANEL)
FIX740LP (FIXED 740px - LEFTPANEL)
FIX740RP (FIXED 740px - RIGHTPANEL)
FIX940LP (FIXED 940px - LEFTPANEL)
...
etc. etc.
PS: if in the example above rightpanel were selected as a variation, the page HEADER would simply read:
<link rel="stylesheet" type="text/css" href="/community/themes/vanilla/styles/default/vanilla.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/community/themes/vanilla/styles/default/vanilla.print.css" media="print" />
<link rel="stylesheet" type="text/css" href="/community/themes/vanilla/styles/variation/rightpanel.css" media="print" />
0
This discussion has been closed.
Comments
My remark was sparked by a the new rightpanel style Stash made... and his reticence to call
it a 'style' when only 20-odd lines had changed.
I then 'diffed' a bunch of styles on my system and noticed the following:
- Default Vanilla.css is 1500 lines
- The vanilla.css file for styles I compared(*) with the default version all differed less than
150 lines, and 80-90% of the changes were mere color palette changes.
The 'style variations' I suggested above (width, color palettes) would require the same or fewer
changes to the default file as Stash's right-panel did.
Hence, to me it made sense to separate REAL styles (i.e. significantly different from the default)
from mere variations on the default as a layered approach could limit the amount of post-release-
updates (the problem of course is where to draw the line...)
Anyway, no need to confuse things further. I just hope the styles I tested are updated to incl.
the new classes for account management, update check form and IE7 fixes.
Perhaps a better conclusion from my little Diff experiment would be to attempt the creation of
a new default-based style that's optimized to separate color from lay-out...
TT
(*) EuropeAfterTheRain, Cloud6, BlackAndWhite, Dizzy, B3SLite, Invader
The reason I backed away from this was because you're then mixing Themes, Style and Extensions together and everything becomes a shade of grey rather than the nice crisp black and white we have currently. I still kinda like the idea, but then it would be best to have a new category of Addon, something like "Sub-Style", or as you suggested "Style Variation".
Another strength of the existing method is that when a style is modified/updated, the variation doesn't get affect. Or is that a weakness - I can't decide...
@Mark: is that a good thing, or does it give you more headaches?
Exactly, a StyleVariation Extension to enforce placement of the 'default style override'
CSS link all the way at the bottom of the linked styles list, should work, not?
e.g.
<link rel="stylesheet" type="text/css" href="/v/themes/vanilla/styles/defaultdefect/vanilla.css" media="screen" /> <link rel="stylesheet" type="text/css" href="/v/themes/vanilla/styles/defaultdefect/vanilla.print.css" media="print" /> [...] <link rel="stylesheet" type="text/css" href="/v/extensions/StuffDisplayer/style.css" /> <link rel="stylesheet" type="text/css" href="/v/extensions/StyleVariation/style.css" />
Krak, I'm NOT proposing to make ALL of the current styles 'variations' (though SOME however are just that...)
It's not that different from the HTML vs XML debate: i.e. do we separate STRUCTURE from REPRESENTATION.
Separating background images and color sets from CSS files seems like a good idea to me, especially since it
would allow *less experienced* users to change just the bare minimum to be "truly original" (something young
people seem to appreciate these days).
I agree it's somewhat muddy, so how about we define a VARIATION on a STYLE as: A style DESIGNER, could offer several COLOR VARIATIONS on the same STYLE (see original post) so we don't
have a glut of styles (VANILLA GREEN, VANILLA BLUE, VANILLA ORANGE) that ALL need to be updated when
the 'base style' changes (or IE8 is published).
We can settle for COLOR only like the drupal peeps did.
Check out the new advanced Drupal 5.0 themes where the theme color definition has become an interactive
experience (either pre-defined or custom color sets). Demo at http://blip.tv/file/141840
-
*edit: added link to drupal demo*
STEP 1: 'VARIFY' the CSS
'Convert' the desired CSS template, into a VARIATION CSS TEMPLATE by replace colors and images with
'variable fields' of format $fieldname:defaultvalue$ e.g. (from Vanilla.css, line 98)
#Header { background:#E5EAF6 url(waves.blue.gif) repeat-x scroll left top; border-bottom:1px solid #ACBEDF; border-top:1px solid #ACBEDF; }
becomes#Header { background: $HDR_BGCOLOR:#E5EAF6$ url($HDR_BGIMAGE:waves.blue.gif$) repeat-x scroll left top; border-bottom:1px solid $HDR_BORDERCOLOR:#ACBEDF$; border-top:1px solid $HDR_BORDERCOLOR:#ACBEDF$; }
STEP 2: Stash or a non-self-proclaimed extension GOD (Mark, Jazz, et al.) will make an extension with THREE elements:
A. COLOR MANAGEMENT UI
- Parses our VARIATION-CSS for color fields & default values ($fieldname:defaultvalue$)
- Let's us CHANGE these values from default to whatever color we SELECT using the JQuery color picker
- STORES these the fieldname/newvalue in the database
B. IMAGE MANAGEMENT UI
- Parses our VARIATION-CSS for image fields & default values ($fieldname:defaultvalue$)
- Let's us CHANGE these values from default to whatever image we select using a JQuery image picker/uploader/cropper/resizer (fixed size equal to old image)
- STORES these the fieldname/newvalue in the database
C. CSS-INSERTION AND PARSING
- INSERTS a VARIATION-CSS' CSS-link as the last CSS link in the header, e.g.
<link rel="stylesheet" type="text/css" href="/v/extensions/StyleVariation/variation-css.php" />
- Variation-css.php, retrieves custom color/image settings, inserts into our 'varified' CSS TEMPLATE, and returns it as a CSS file (on-the-fly or cached)
Notes:
- In the example above ONE variable ($HDR_BORDERCOLOR) is used in TWO places. For more variation, we could have inserted $HDR_BORDERCOLOR_TOP and $HDR_BORDERCOLOR_BOTTOM
- I suspect that converting a CSS template to a VARIATION CSS TEMPLATE *could* even be automated... (parse CSS file, look for color values or images, e.g. #FFBBCC, replace color value or image with $fieldname:defaultvalue$, e.g. $COLORFIELD[44]:#FFBBCC$, etc. etc.).
Whoo... me likey... if we add the image thing (not required at first) then we out-class even Drupal!
What I proposed originally (extract parts of the CSS, store variations) is not what I ended up with (i.e. take an
existing style, make parts of it variable as fields, store the values for those fields variables). The END RESULT
could be almost the same however, allowing for more variations, more user control, easier upgrade paths, etc.
This 'VARIFYING' thing I just pulled out of my *** should really make things easier... (EXISTING STYLE conversion
is a mere smart REGEXP GREP away).