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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

davidhernandez created an issue. See original summary.

davidhernandez’s picture

.button:first-child, .image-button:first-child

What 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.

LewisNyman’s picture

What is the use-case for specifying first-child here?

You 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.

davidhernandez’s picture

Is there a way to ensure that admin.css files load last...

Not 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:

.region-title .button {
    margin-left: 1em;
}

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.

LewisNyman’s picture

Why 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.

davidhernandez’s picture

That would require an architectural change to how CSS is processed/loaded. I don't know that we can get away with that right now.

LewisNyman’s picture

That'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.

LewisNyman’s picture

Issue summary: View changes
FileSize
874.19 KB
LewisNyman’s picture

Status: Active » Needs review
FileSize
1.29 KB

Here'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.

core/modules/block/css/block.admin.css
core/modules/ckeditor/css/ckeditor.admin.css
core/modules/color/css/color.admin.css
core/modules/config_translation/css/config_translation.admin.css
core/modules/content_translation/css/content_translation.admin.css
core/modules/field_ui/css/field_ui.admin.css
core/modules/file/css/file.admin.css
core/modules/filter/css/filter.admin.css
core/modules/image/css/image.admin.css
core/modules/language/css/language.admin.css
core/modules/locale/css/locale.admin.css
core/modules/menu_ui/css/menu_ui.admin.css
core/modules/node/css/node.admin.css
core/modules/system/css/system.admin.css
core/modules/user/css/user.admin.css
core/modules/views_ui/css/views_ui.admin.css
davidhernandez’s picture

I'll have to try it out, but that looks like a good solution.

davidhernandez’s picture

Title: Fix any visual regressions from moving the System CSS to Classy » [regression] Fix any visual regressions from moving the System CSS to Classy
gints.erglis’s picture

Status: Needs review » Reviewed & tested by the community

#9 tested, no regressions found

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 10391fc and pushed to 8.0.x. Thanks!

  • alexpott committed 10391fc on 8.0.x
    Issue #2567845 by LewisNyman, davidhernandez: [regression] Fix any...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.