Closed (outdated)
Project:
Corolla
Version:
6.x-1.17
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Oct 2010 at 15:39 UTC
Updated:
29 Feb 2016 at 00:35 UTC
Jump to comment: Most recent
The color scheme CSS is added as inline CSS instead of as a separate file. It is too much and too persistent to be inline code and it should be added as an external file instead.
Comments
Comment #1
heygabe commentedAdditionally, this makes customizations to the color themes kind of frustrating. Unless I'm missing something.
Comment #2
jarek foksa commentedI fully agree with you that inline styles are ugly and their use should be discouraged. But is there any alternative in this case? AFAIK Drupal Core does not provide API that would allow me to generate external CSS files dynamically or put PHP variables inside already existing CSS files.
Comment #3
xanoDrupal core already generates CSS files dynamically. Go to Administer > Site configuration > Performance and turn on CSS aggregation. Then check the page's source code and you'll notice only a single CSS file is being used and it's located in /sites/*/files/.
Comment #4
jarek foksa commentedBy dynamically generated CSS file I meant stylesheet that would be filled with values provided by theme_get_setting() function.
I guess I could reuse those code snippets to get all stylesheets into one variable and then perform some string replacement operations on it, but this would be even less elegant solution than the current one.
Comment #5
xanoAll you have to do is store the CSS you now generate during every page load in a separate file and add that file with drupal_add_css().
Comment #6
jarek foksa commentedOK, I see now that this might be possible, but what's the code snippet for storing variable into separate file?
Comment #7
nicholas.alipaz commentedI got to thinking about how to do this for another project I am working on and found this page via searching. One of the first ideas that came to mind was hook_menu and a custom callback:
Creating the css works, loading the menu item does too. drupal_add_css() does not: http://drupal.org/node/329812
So in the end there is no way to make that code work from what I can tell. I even tried doing drupal_add_css() for a real file then using @import to include my page, but that didn't work either.
Alternatively, looking at the core color module may be of use in what we are trying to do.
Comment #8
nicholas.alipaz commentedOK, through some research of color module and other things that I came upon, I came up with:
I hope that helps you guys get your issue sorted. I am not using corolla at the moment, only found this because it related to something I was working on. Good Luck and happy coding.
Comment #9
Jeff Burnz commented