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.
Follow up to #2566597: [Mega patch] Move system *.theme.css files to Classy
Lewis spotted one regression. The place block button lost its left margin.
Fix this and any others the are found.
Comment | File | Size | Author |
---|---|---|---|
#9 | fix_any_visual-2567845-9.patch | 1.29 KB | LewisNyman |
#8 | Block_layout___Site-Install.png | 874.19 KB | LewisNyman |
Comments
Comment #2
davidhernandezWhat is the use-case for specifying first-child here? If that were removed from the Class button.css it will fix the block placement button problem.
Comment #3
LewisNymanYou don't want to add spacing to the left of a button when it's on it's own, it will break alignment. We have some examples of this and a long discussion in #2160621: Button spacing CSS is too fragile
Is there a way to ensure that admin.css files load last without moving them into Seven? It seems like fixing the individual bugs will take a long time, and this kind of thing will mean contrib modules will have to write really specific CSS to ensure it applies.
Comment #4
davidhernandezNot if they are provided by a module. That seems to be by design, that any CSS provided by a module is grouped together and loaded before and theme CSS.
This is the rule in question, provided by the block module's block.admin.css:
We could copy this to Classy; otherwise, we'd have to figure out some specificity that can override the first-child.
On a plus, I've been clicking around everywhere and haven't noticed any other problems. So no glaring WTFs yet.
Comment #5
LewisNymanWhy don't we change that design for admin CSS? Any overrides for the admin UI has to load after the admin theme to ensure it takes effect without adding meaningless specificity.
Comment #6
davidhernandezThat would require an architectural change to how CSS is processed/loaded. I don't know that we can get away with that right now.
Comment #7
LewisNymanThat's true. My recommendation in this situation is to add a wrapper div with a complete different class, and then use that to shift the placement of the block. Something like
.region-title__action
? That would avoid conflicts like this.Comment #8
LewisNymanComment #9
LewisNymanHere's a patch for the block placement button.
Here's a list of all the admin css files in modules so we have a good idea where to look.
Comment #10
davidhernandezI'll have to try it out, but that looks like a good solution.
Comment #11
davidhernandezComment #12
gints.erglis CreditAttribution: gints.erglis commented#9 tested, no regressions found
Comment #13
alexpottCommitted 10391fc and pushed to 8.0.x. Thanks!