In my particular case I am going to need to replicate the various themes I am offering to my users, simply for the sake of offering them multiple color schemes for each layout.

If it were possible to create alternative css files -- something like themename.alt1.css. themname.alt2.css, etc -- and then extend a rule to state:

IF condition
THEN themename
AND theme_css_file

... then I wouldn't have to create whole theme copies for the purpose.

It would multiply the power of the module considerably. And it would considerably reduce the development/maintenance workload.

Of course, this would make the internal code and selection block operation more complex, and would probably require establishing a naming scheme for alternate css files. Not to mention that there would have to be appropriately named images for the various preview images. So it might be more trouble than it's worth on the module coding/maintenance side.

Not that Themekey isn't terrific just the way it stands. This is a truly excellent and useful module.

Comments

mkalkbrenner’s picture

Title: A thought on my application/use-case that might be interesting to you and others ... » add aditional css file by rule

I'll consider this

miiimooo’s picture

Hi Markus, I would find this functionality really useful too, Or instead something where you add some CSS class to the body tag. Have you done any work on this? Would you accept a patch if I implemented this functionality? And would you have any suggestions or guidelines for an implementation?

mkalkbrenner’s picture

I didn't start the feature right now. But I will accept patches ;-)

I see two different ways to implement it:

1. Add a kind of text field beside the the theme to select in the rule chain to enter additional sytle sheets which will be added using drupal_add_css().

2. Create a separate rule chain for adding style sheets. Add a new checkbox to every rule to indicate if processing the rule chain should stop or not if a rule matches. This way it's possible to add multiple style sheets with multiple conditions.

Thoughts?

mkalkbrenner’s picture

Version: 6.x-3.0 » 7.x-2.x-dev

Should be implemeted for 7.x first and than backported.

ifish’s picture

Need this also.

mkalkbrenner’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Assigned: Unassigned » mkalkbrenner
Status: Active » Needs review

A first experimental implementation has been added to ThemeKey 7.x-3.x. It's wrapped in a sub-module called themekey_css.
http://drupalcode.org/project/themekey.git/commit/86385b4

mkalkbrenner’s picture

Assigned: mkalkbrenner » Unassigned
Issue tags: +Needs tests
mkalkbrenner’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.