How do you override the drupal css in drupal 5
This code no longer works
function phptemplate_stylesheet_import($stylesheet, $media = 'all') {
if ($stylesheet != 'misc/drupal.css') {
return theme_stylesheet_import($stylesheet, $media);
}
}
There is no longer a misc/drupal.css file - the default css is now in modules/system/default.css
But i cant work out how to override it
My problem is the blocks are wider than my sidebar, i used the bluemarine theme and made a 2 column css layout
Also when building my css based theme i had to add these css rules to stop the profile and create content forms appearing at the bottom of the page
.profile {
clear: none;
}
.node-form .standard {
width: auto;
clear: none;
}
Hope that helps someone
Comments
Take a look at this handbook
Take a look at this handbook page: Converting 4.7.x themes to 5.x. It's loaded with good tips on this, but here is the relevant excerpt:
-zach
--
harkey design
: z
Not working?
I am trying this and have trie it in several ways. I'm trying to get rid of defaults.css... I've tried the following:
unset($css['core']['misc/defaults.css']);
unset($css['core']['modules/system/defaults.css']);
unset($css['core]['system/defaults.css']);
however, print_r($css); at the bottom of the page still shows defaults somehow getting through and the styles are still there.
Any help with this?
-gary
You are right hapworth. When
You are right hapworth. When I print_r($css) in my page.tpl.php I find no 'core' key in the $css array.
While this is undocumented anywhere, the following technique seems to accomplish the desired results.
To flat-out remove 'defaults.css', in page.tpl.php I would
replace
with
Alternatively I could provide my own replacement stylesheet. For example, if I don't like all of the default primary and secondary tabs styling, which are styled in system.css, I could use
-zach
--
harkey design
: z
remove system stylesheets
Is it possible to execute the stylesheet exemption code in the template.php file? I see that zen.css now loads stylesheets in template.php instead of page.tpl.php.
Code from Zen template.php
It would be nice to be able to keep all of these declarations together.
Aggregate and compress CSS files
So aggregating and compressing CSS files still work properly after "unsetting" default/system/module styles? Am I correct believing that Drupal caches whatever your final output of $styles is? From the commented section in the post above, it seems that @imports inside of a stylesheet added with drupal_add_css() do not get added to the cache.