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
Comment #1
effulgentsia commentedI have no opinion on this. Just moving it to the "drupal.css" queue for people monitoring those issue to decide what to do with.
Comment #2
sun.core commentedMoving "drupal.css" component issues to "markup".
Comment #3
jacineSome of this is necessary, some of it isn't and some is just done wrong.
This should probably just be a
<strong>, or even a heading tag.This should go.
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
Comment #4
dman commentedHm. 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.
Comment #5
sunComment #6
sunI 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.
Comment #7
dodorama commentedI 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.
Comment #8
dodorama commentedI did a first patch starting from the aggregator module. Let me know what you think.
#749530: Clean up aggregator css styles
Comment #10
joachim commented> 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.
Comment #11
dodorama commentedI 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
Comment #12
jacineThanks for moving this along @dodazzi! :D
Comment #13
jacineComment #14
sunWhat we should do here is to introduce $file.base.css and $file.theme.css like we did for System module already.
Comment #15
jacinetagging.
Comment #16
jacine.
Comment #17
cosmicdreams commentedI'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.
Comment #18
devin carlson commentedThe 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.
Comment #19
yesct commentedcorrecting the tag to the more common one.
Comment #20
lewisnymanThis issue has been superseded by the CSS standards. No need to keep it open.