I'm pretty sure I'm missing something (in that case feel free to yell at me at close the issue without further notice).
Anyway, why most drupal core modules ships with css files? Looking at a bunch of them it seems to me that most of the properties are there for cosmetic reasons and in my opinion this should be delegated to the theme'scss. Most of the time those styles are only a problem cause you have to override them and they're spread in a lot of files.
As an example this is block.css

#blocks tr.region-title td {
  font-weight: bold;
}
#blocks tr.region-message {
  font-weight: normal;
  color: #999;
}
#blocks tr.region-populated {
  display: none;
}
.block-region {
  background-color: #ff6;
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 3px;
}

Only the '#blocks tr.region-populated' is there for a reason (to make the draggable rows work properly by hiding the empty text). All the rest is just cosmetic cruft. If you agree I can try to write a patch and probably get rid of some of those nasty CSS files.

Comments

effulgentsia’s picture

Component: theme system » drupal.css

I have no opinion on this. Just moving it to the "drupal.css" queue for people monitoring those issue to decide what to do with.

sun.core’s picture

Component: drupal.css » markup

Moving "drupal.css" component issues to "markup".

jacine’s picture

Some of this is necessary, some of it isn't and some is just done wrong.

#blocks tr.region-title td {
  font-weight: bold;
}

This should probably just be a <strong>, or even a heading tag.

#blocks tr.region-message {
  font-weight: normal;
  color: #999;
}

This should go.

.block-region {
  background-color: #ff6;
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 3px;
}

Margins should likely go, possibly padding too, but background color should stay as this is meant to show the user where the regions are in the block admin.

Removing as much of this cruft as possible is definitely a good idea, so please go for it :D

dman’s picture

Hm. It's a fine line. How much of the 'margins' define the UI, and how much of them are cosmetic?
Yeah, kill the font-weights.

In any case, we really should follow the accessibility guidelines and either NOT override colors, or ensure that we are overriding colors and background colors at the same time.

So many themes used to fail in the admin pages because of white-on-light or dark-on-dark text when theme colors met core css. It would be nice to maintain a policy of killing that wherever we can.

sun’s picture

Title: Clean up code: Remove cosmetic cruft from module's css files » Remove cosmetic cruft from module's css files
Category: task » bug
sun’s picture

I think we can draw the line at the point where a core theme needs to reset the module styles to make it look good in the particular theme. As that clearly means: the core theme(s) won't be the only theme that needs to do it.

This effectively means that removing the horrible mess in reset.css of Seven theme is a very good starting point.

However, when drawing this line, we also need to take into account that the resulting styling should still look somewhat acceptable in Stark.

dodorama’s picture

I think that drawing a line is really difficult. This is why I'd say, just remove everything and keep only the styles that make the UI work correctly (i.e stuff needed by javascript). After all Stark isn't meant to be a production theme. It's there just to demonstrate Drupal's default HTML markup and CSS styles. By the way every theme that pretend to be usable as an admin theme will override most of this styles anyway.

dodorama’s picture

I did a first patch starting from the aggregator module. Let me know what you think.
#749530: Clean up aggregator css styles

joachim’s picture

> However, when drawing this line, we also need to take into account that the resulting styling should still look somewhat acceptable in Stark.

Yup.

Stark isn't meant to be a production theme, but equally, there is a balance to be found between themes having to muck about with reset.css type stuff, and themes having to waste time providing basic UI styling. It's the job of module CSS to provide reasonably useful layout with a minimum of CSS styling.

dodorama’s picture

I posted a revised patch for the Aggregator module and two new one for the block and book modules.

#865084: Clean up block module css styles
#749530: Clean up aggregator css styles
#865146: Clean up book module css styles

jacine’s picture

Thanks for moving this along @dodazzi! :D

jacine’s picture

Version: 7.x-dev » 8.x-dev
sun’s picture

What we should do here is to introduce $file.base.css and $file.theme.css like we did for System module already.

jacine’s picture

Issue tags: +frontend

tagging.

jacine’s picture

Issue tags: -frontend +Front end

.

cosmicdreams’s picture

I'm ready to help out with this effort. Sounds like what is needed is to do the somewhat tedious work of making patches that separate out the css for each of the core modules into properly targetted files. I'm able to help out with that effort. And will try to put some patches together in June for each of the core modules.

It seems that's a good first step as we will likely need to see if removing this css really breaks the use of a module or not.

devin carlson’s picture

Component: markup » CSS

The initiative page for this task can be found at http://drupal.org/node/1089868 which provides guidelines and links to the individual issues filed for each core css file in need of cleanup.

yesct’s picture

Issue summary: View changes
Issue tags: -Front end +frontend

correcting the tag to the more common one.

lewisnyman’s picture

Status: Active » Closed (duplicate)

This issue has been superseded by the CSS standards. No need to keep it open.