Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
See: #2489460: [Meta] Move module.theme.css files to Classy or Seven
Proposed resolution
Move the CSS file to classy
Create a library for the CSS file
Add the library in the Classy twig template
Remaining tasks
User interface changes
None for Classy, Stark will be more Stark
API changes
None
Beta phase evaluation
Issue category | Task because CSS should live in the same place as the markup |
---|---|
Issue priority | Not critical |
Unfrozen changes | Unfrozen because it only changes CSS |
Comment | File | Size | Author |
---|---|---|---|
#4 | Plan_9___D8_twig.png | 354.98 KB | mortendk |
#4 | Plan_9___D8_twig.png | 343.66 KB | mortendk |
#4 | move_book_theme_css_to-2489474-4.patch | 2.21 KB | mortendk |
#2 | 2489474-book-classy-2.patch | 3.86 KB | Manjit.Singh |
#1 | 2489474-book-classy-1.patch | 2.94 KB | LewisNyman |
Comments
Comment #1
LewisNymanHere is an example patch
Comment #2
Manjit.Singhremoving css file from modules as well :)
Comment #3
lauriiiComment #4
mortendk CreditAttribution: mortendk as a volunteer commentedRerolled patch to make it easier to read for review & added screenshots.
Before:
After:
Comment #5
LewisNymanAdded beta evaluation. I think we should update the Classy change record to cover all the child issues of #2489460: [Meta] Move module.theme.css files to Classy or Seven
Comment #6
lauriiiThank you folks for working on this! I tested this manually and there's no visual change on Bartik which is good. The code changes what it should and stays in the scope of the issue and is clean against Drupal coding standards.
Comment #7
davidhernandezShouldn't the ".theme." bit be removed from the CSS file name, since it is redundant now being in the theme?
Comment #8
LewisNymanNot in this issue, as we aren't removing the MAT concept until we've completed #2489666: [meta] Split module CSS files into SMACSS component CSS files
Comment #9
davidhernandezI know that is the case with the system module CSS, but the book CSS seems fairly self-contained. Does it need breaking up?
Comment #10
LewisNymanI'm trying to think back to the discussion we had at Drupalcon. I think the problem is just consistency, it would be better to have remove all references of *.module.css and *.theme.css in one go instead of having some with and some without. If we are being ambitious we could do it issue per issue, the file renames would be quite easy to do in one issue though.
Comment #11
davidhernandezYou're right. I do remember now. But, thinking about it, isn't the inconsistency leaving the .theme? We use it in modules, but none of the themes do and this is being added to a theme. So those file names will be living in Classy until they get changed, if they get changed.
Buuut, I'm satisfied that you're keeping track of it. I just wanted to make sure I understand and that this wasn't an oversight.
Comment #12
mortendk CreditAttribution: mortendk as a volunteer commentedlets just get all the files over then lewis can go banana's on renaming em all ;)
Comment #13
alexpottI grepped the code base to ensure all the classes used in the css file are only in classy and it's sub themes - they are. So this is good to go. Committed f6b2354 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.