Closed (fixed)
Project:
Drupal core
Version:
main
Component:
node system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Sep 2014 at 14:15 UTC
Updated:
23 Mar 2026 at 22:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lewisnymanIn order to implement this as the current design we need to add new classes to system.admin.css:
We then replace these classes:
Comment #2
pivica commentedHere is a first patch for this - its not just adding two more classes and changing class names in twig template because grid of this form is working little differently then current default grid css from system.admin.css:
Gutter of node edit form is bigger then default one so added .layout-container--bigger-gutter modifier.
.layout-column.third and .layout-column.two-thirds are on 35% and 65% as they were in original css - not sure about this, guess that 33.3333% and 66.6666% has more sense?
and that is why for now i leaved previous classes in node-edit-form.html.twig so specific part of form can be targeted when needed by css.
- in grid css we are using 'em' for break points but for widths there is a mix of 'px' and 'rem' units used, for example
Should we maybe switch to rem units in breakpoints also?
Also why we are using a mixin of 'px' and 'rem' units for width for toolbar, i saw this mixin in other places also when margin is specified for some elements?
Wondering should we maybe introduce more formal grid implementation with 12 column options and one breakpoint for small screens like we have now on 38em?
Beside all this css works OK - tested in Chrome and FF and tested rtl. One difference is small change of 2em in current columns because original css used right padding and our grid use left padding, but this should not be a problem.
Comment #3
idebr commentedIf
.two-thirdsis a version of.layout-column, should it not be.layout-column--two-thirdsaccording to the BEM naming policy?Comment #4
lewisnyman@idebr Yes you're right, we should add a follow up issue for that.
Comment #5
axe312 commentedPatch looks good, it cleanly removes the custom code from node.module.css. The left over part might be fixed with a proper grid implementation which was already mentioned by Pivica.
The fix with the --no-margin seems bad, but the issue here is that we need a proper grid system which supports nesting of grids. There we should also keep our naming policy in mind. Pivica and me are creating a proposal for proper grid system, ill add the link later on.
Also the change to rem as unit should be done, we should use #2298015: [policy] Document when we should use each CSS unit as follow up here.
Comment #6
lewisnymanOk I think the CSS is not ideal but I think we can clean it up more in other issues. We need screenshots to show that it is not broken.
In #2335531: Replace block placement page layout CSS with reusable layout classes I suggested we move these styles into system.admin.css. At least the parts that only affect layout-column. I don't mind if we do that in this issue or the other one as long as we remove the duplicate code from here once it's been done.
Comment #7
lewisnymanAlso I created the follow up #2471739: Convert reusable layout classes to BEM standards
Comment #8
axe312 commentedHere are the screenshots.
The layout difference here is because of the way the gutter is applied to the grid. Before the patch it used padding-right on the left column, so the content was actually 2em smaller than the set value. The new layout classes use padding-left on every element except the first one, that is smarter, but results here in a small change of the form layout.
Lets remove the toolbar code in an follow up ticket, we may fix it directly in the patch for the new proposed grid in #2471791: Improve the CSS layout framework for Drupal's admin interface
Comment #9
axe312 commentedComment #10
lewisnymanI went through this issue with the intention of trying to remove as much custom CSS as possible.

I looked at what this CSS was doing and it doesn't seem to fix the regression. The problem here is that the second column is floated left when it should be floated right.
If we change this class so it's not a variant of the .layout-container than we don't have to require the .layout-container class. Maybe just call it .layout-bigger-gutter?
I think that we wouldn't need this if we didn't nest .layout-container. It seems like we could just use the clearfix class instead
Comment #11
lewisnymanComment #12
axe312 commentedComment #13
axe312 commentedThis patch fixes the floating issue of the form footer (Save and preview button), moves the bigger gutter modifier to the column and replaces the no margin layout container by a simple div.clearfix.
I had to apply some custom styling to the columns to achieve this. We really need a proper solution for layouting the columns, which we are already discussing about here in Montpellier.
Comment #14
lewisnymanNice thanks.
Can we do everything possible to avoid using important? It will make our csslint count go up. How about
.layout-column.layout-region-node-secondary?It also needs the LTR comment next to it
This should also be moved down so it's about the RTL stlyling. It also needs an LTR comment against it.
This selector should appear directly after the LTR group
I can't see why but this doesn't seem to apply when it should
I guess this also needs RTL styling?
Comment #15
dpetruk commentedI've done some fixes.
Comment #16
lewisnymanThanks, I've made a few tweaks so this is inline with our coding standards. This is good to go.
Comment #17
idebr commentedLet's add a comment what temporary fix actually fixes, so it can be updated later on.
The float attribute is being overridden by [dir="rtl"] .layout-column in system.admin.css. This results in the node actions being placed at the very bottom the page, similar to #10
These numbers do not match.
Comment #18
marieke_h commentedComment #19
marieke_h commented1. I didn't really know what to add as a comment here. Is something like this ok?
Is there already an other issue where there is a discussion about the layouting of columns? I wanted to add the link in the comment.
2. It's not clean to use !important here, but I don't really see an other option? If I understand correctly, this is also temporarily code?
3. I updated the numbers to match
Comment #20
lewisnymanThis is because the system.admin.css is being loaded after node.module.css - this is weird because the rest of the system CSS is always loaded first:
system.libraries.yml
I modified the system.libraries.yml and node.libraries.yml so that system.admin.css always loads before node.module.css. Once we break up system.admin.css into component files then this would be a lot easier to do properly.
Comment #21
idebr commentedIt appears the patch in #20 includes code related to #2408463: Rewrite entity-meta component inline with our CSS standards. The interdiff seems correct.
Comment #22
marieke_h commentedI updated the patch from #20 to match the interdiff.
Comment #23
emma.mariaThe patch in #22 needs a reroll.
Comment #24
kostyashupenkoRe-rolled
Comment #26
kostyashupenkoRe-rolled again patch #22 for v8.1.x
Comment #28
kostyashupenkoPlease pay your attention to https://dispatcher.drupalci.org/job/default/77610/testReport/junit/Theme...
That's why test was not successful
Comment #29
andypostTest needs to be fixed according libraries changes
this caused the test to fail
Comment #30
kostyashupenkoHere appeared a new test core/modules/system/src/Tests/Theme/StableLibraryOverrideTest.php (that's why previous patches was passed)
Comment #46
quietone commentedChecking in here to find out if this is still relevant to Drupal 10/11.
If this needs to be done, add a comment and set the status to Active. Thanks. Otherwise, if you know this is outdated, close it as such
Thanks!
Comment #47
acbramley commentedIt looks like this CSS still exists but I wonder if any of it is still relevant anymore? Some of the classes do seem to be used by classy, demo_umami, and starterkit themes but I wonder if they actually do much.
Gin also uses many of these classes so we'd need BC here.
Comment #48
catchCould we try to remove the CSS rules and check whether there's any change in Claro or Gin? It would be good to remove unnecessary CSS if we can.
Comment #49
smustgrave commentedFor #48
Comment #50
acbramley commentedAlso need an IS update here, I'm guessing from the existing patches this is just referring to the styles in node.module.css
Comment #51
acbramley commentedLooking at node.module.css we have styles for:
1.
.layout-regionthis only has one rulebox-sizing: border-box;which Claro also has in its form-two-columns.css. This looks pretty safe to remove2.
.layout-region-node-mainand.layout-region-node-footerand.layout-region-node-secondaryThese classes only appear in 3 places that aren't CSS files. Those are node-edit-form.html.twig in the demo_umami theme, the starterkit_theme, and in gin itself. Gin also has a lot of CSS rules for these same classes.Funnily enough, none of these classes (apart from layout-region) are on the node form after installing standard profile both with and without the "Use the administration theme when editing or creating content" setting (i.e in Claro and Olivero)
TLDR; these are looking quite safe to remove. I will need to test across a few of these areas as well as with the vertical toolbar enabled as there are some special rules for that too.
Comment #52
acbramley commentedTo make things even stranger:
node.module.css is in 2 different libraries -
node/drupal.nodeandnode/formBoth libraries are only attached in a single place in core - NodeForm.php
Claro removes the node.module.css file from both libraries via libraries-override
stable9 replaces node.module.css from both libraries with its own node.module.css file
I think in this issue we should also remove the node/form library entirely.
Comment #53
acbramley commentedI've tested across Gin, Claro, and Demo Umami (with editing in admin/fe theme) and these classes aren't used in any of them. I think we can even remove the node-edit-form.html.twig from umami as well as that is not used at all.
Comment #54
acbramley commentedComment #56
acbramley commentedComment #57
smustgrave commentedOnly question is do we need to deprecate from the node module?
Comment #58
catchIt would be possible to leave the library empty and deprecate it for removal in Drupal 12 maybe - that would notify when something attaches it or depends on it.
Comment #59
smustgrave commentedIs it worth doing? Not sure if anyone depends on the library but have been surprised by less.
Comment #60
acbramley commentedI tried that and you can't, you get an error about an incomplete library
Comment #61
smustgrave commentedSo is it worth doing the full deprecation and leave the library for now?
Comment #62
catchWe should open a spin-off about that maybe - could probably check if the library is deprecated or not and allow empty deprecated libraries, but it shouldn't block this one.
Tried to search for usages and didn't get useful results, but it did find one components/content_edit/node_edit_form/node_edit_form.component.yml
https://git.drupalcode.org/search?group_id=2&scope=blobs&search=node%2Ff...
Comment #63
smustgrave commentedThis is used in seven in contrib. Know that's not core but a lot of sites still use that theme. So what's the concern there if we just remove vs deprecate?
Comment #64
dcam commented@smustgrave I took a peek at this issue and wondered wondered how Seven was using the library. But I can't find a reference to either removed library in there. I see Seven's own node library. I've triple-checked, but I admit that maybe I'm just clueless. Still, I wanted to mention it in case you were mistaken. If I've just overlooked it, then please feel free to let me know.
Comment #65
smustgrave commentedYou're right.
Wish we could do a deprecation but the project for components/content_edit/node_edit_form/node_edit_form.component.yml doesn't have a D11 release so as long as this isn't backported shouldn't break that.
Comment #66
catchNeeds a rebase unfortunately.
Comment #67
dcam commentedRebased. The conflict was in
stable9.info.ymldue to the addition of Navigation libraries.Comment #68
catchWe need a change record here to inform themes they no longer need to override the library.
Comment #69
dcam commentedI sat down to write the change record and then realized that
node.module.cssisn't removed from the Node module directory. Is this correct or should it be deleted too? Is it because we can't leave the library empty as noted in #60?Setting to Needs Work for the change record.
Comment #70
catchLooking at this again I think we should remove the file from the node/drupal.node library. Then for the drupal/form library deprecate it without touching the files, and remove the file in Drupal 12. If we don't delete the file yet, we can deprecate the library, if we're not adding the library anywhere in core, then we're not using a deprecated library. I didn't re-read the issue to see if this option was tried, but my previous attempt to suggest a deprecation would have relied on the ability to deprecate an empty library which isn't possible yet.
Comment #71
acbramley commentedComment #72
acbramley commentedI think I've actioned #70 (as I understand it) but what do we do with Claro and Stable9 that are overriding that (now deprecated) library?
Comment #74
smustgrave commentedCan this get a rebase.
Comment #75
dcam commentedI rebased it, but the tests are failing.
Comment #76
acbramley commentedTests are failing due to #72 - not sure what the fix is here.
Comment #77
catchI think we can remove the claro and stsble9 overrides given we think this is dead CSS.
Stable9's BC promise only works for keeping old styles in the same file, it really does not work at all when files are being moved around or become unused. And we're planning to move it to contrib anyway.
Comment #78
acbramley commentedPerfect! Rebased and removed the overrides.
Comment #79
smustgrave commentedBelieve feedback for this one has been addressed.
Comment #80
benjifisherSince Drupal 11.4.0 and 12.0.0 will be released together, it is unusual to deprecate in 11.4.0 and remove in 12.0.0, but there are exceptions. Should this be one of them?
I notice several comments about removing in D12, but those were before the release of 11.3.0, so maybe they were assuming we would deprecate in 11.3.0 and remove in 12.0.0.
Comment #81
longwaveWhat about
core/themes/starterkit_theme/templates/content-edit/node-edit-form.html.twig- shouldn't this be deleted here too?Tagging for a followup where we can actually delete node.module.css as well, we should link that from the comment in Stable9LibraryOverrideTest.
Comment #82
acbramley commentedDone! #3573705: Remove the node.module.css file and node/form library
Comment #83
dcam commentedI reviewed the changes since the last RTBC.
node-edit-form.html.twigwas deleted from thestarterkit_theme. The test comment was updated with a working link to the follow-up issue. They look good to me.Comment #84
andypostNot sure that changing stable9 theme makes sense, it should went to obsolete state
Comment #87
catch@andypost if we don't change stable9 we have core test coverage that fails, so we need to keep it updated up until we remove it unfortunately.
Committed/pushed to main and 11.x, thanks!
Comment #90
smustgrave commentedShould we open a follow up to remove the deprecations from main?
Comment #91
acbramley commented@smustgrave you mean this one? https://www.drupal.org/project/drupal/issues/3573705