I need to load different CSS depending on a field value.

I have a content type where the user can select either "blue" or "red". And depending on that a different color theme should be used for that node.

I was thinking of checking the value in a preprocess function and then use drupal_add_css() to load the respective color theme.

Is that possible? Or anyone has a better idea?

Comments

nevets’s picture

Field formatter CSS class sounds like what you are looking for.