Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I just traced a styling problem back to system.theme.css (in /modules/system). I discovered that this problem has existed in D7 since at least 2006, and that Dries opted against fixing it as of 2011, to avoid the risk of affecting existing themes.

I disabled the entire file (system.theme.css) and don't notice any differences on my site, either the public facing side or the administrative UI. Is there any reason to keep it around?

The bigger (and real) question, though is: what is the accepted solution to this problem? I can see several possibilities, but all have potential drawbacks, and I'm sure (since every user of D7 faces this ugliness) there are others who've tried several approaches and can advise all of us which are best.

Here are some possibilities:

  • edit the file
  • delete the file
  • override the offending selector (tbody) with a different rule in another CSS file
  • something else I haven't thought of

I don't really like the idea of modifying core, so the first two are not great, but I don't want a bunch of CSS being loaded that isn't being used either. What is the normal solution to this?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

It's got to be option 3 (overriding the offending selector (tbody) with a different rule in another CSS file) really, the only potential drawback is a few extra bytes of data to download and a fraction of a millisecond in processing time at the client end to apply the override. Both so small as to be unnoticeable.

CSS was built to be cascading so overriding a previously set style is well in keeping with the spirit of the 'language'. This has always annoyed me too and I pretty much instinctively add the override style when creating a theme from scratch. It hasn't caused me any problems to date and I can't see it doing so in the future.

That said, if you don't need the styles from system.theme.css the best thing to do would be to remove it completely with hook_css_alter()

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.