By zagnutts on
I am adding a new content type via cck that I need to theme and I was wondering what the most efficient way to do this was.
Is it best to add the tags in style.css. I am worried that style.css will grow too big and cause every page on the site to load slower because of the larger file size. There must be a better way.
Should I create a seperate css file and load it via drupal_add_css() in node-[contenttype].tpl.php? I've never used this function and was wondering if this is even possible. If so, would this be a better option?
If there is a better practice let me know.
Comments
A CSS file for the site only
A CSS file for the site only downloads one single time per visitor. After that it is cached and loads instantly from the user's browser cache.
...
HTTP requests are expensive, in any case if you turn on CSS compression its all one big file anyhow, although somewhat compressed the main performance enhancement is the reduction in HTTP requests. If you cant use CSS aggregation and compression its better to have a few big files, rather than lots of small files. While Keyz is exactly right, it can be a problem when you average page views are 1.5 and 90% is new traffic, so it really just depends on your site.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.