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
The block placement page implements a custom two column layout in CSS.
Proposed resolution
Remove the custom CSS and implement the reusable classes introduced in #2017257: Create generic layout classes
Remaining tasks
Document before-and-after testing on RTL.
User interface changes
None
API changes
None
Beta phase evaluation
Issue category | Task because coding standards |
---|---|
Issue priority | Not critical because coding standards |
Unfrozen changes | Unfrozen because it only changes CSS/markup |
Comment | File | Size | Author |
---|---|---|---|
#45 | replace-block-placement-page-layout-css-2335531-45.patch | 3.25 KB | pjbaert |
#45 | interdiff-33_45.txt | 840 bytes | pjbaert |
#37 | rtl-after-block-layout.png | 231.68 KB | Manjit.Singh |
#37 | rtl-before-block-layout.png | 231.43 KB | Manjit.Singh |
#37 | after-block-layout.png | 229.04 KB | Manjit.Singh |
Comments
Comment #1
LewisNymanThese classes need replacing:
Comment #2
pjbaertRemoved the custom CSS and implemented the reusable classes
Comment #3
LewisNyman@pjbaert Nice, thanks. It seems like we have to keep the
.block-list-secondary
class because it is used for some styling:In block.admin.css:
Let's keep it for now and try and figure out how we can remove it in another issue.
We can remove this CSS from block.admin.css
This is useful CSS that we can use for all of the layout-column classes. Can we move this CSS into system.admin.css but replace the selectors with just:
.toolbar-vertical.toolbar-tray-open .layout-column
Comment #4
pjbaertHi @LewisNyman
Thanks for the feedback.
I processed you remarks from #3 in this patch.
Comment #5
MathieuSpil CreditAttribution: MathieuSpil commentedComment #6
MathieuSpil CreditAttribution: MathieuSpil commentedComment #7
MathieuSpil CreditAttribution: MathieuSpil commented1. Fixed typo in classname:
.three-quarters
should be.three-quarter
2. The html of the sidebar: We should keep the
.block-list-secondary
-class inside the twig for its border. And we should also keep thequarter
-class for the width properties. The html is now:3. Fixed weird whitespace in/after media-query:
is now
4. Removed the extra use of the
.layout-container
-class. Otherwise we are nesting.layout-container
inside.layout-container
5.
@Lewis: I don't think we should keep this for another issue, now the page looks weird because the sidebar now receives a padding-left of 10px (because it is the second layout-container in it's parent) But the
.block-list-secondary
-class gives it a border-left... Which is a bad combination (weird whitespace, see screenshot...)I suggest we don't try to restyle this page but rewrite some css so there is no visual change, and it still works with the new layout classes?
Comment #8
MathieuSpil CreditAttribution: MathieuSpil commentedComment #9
MathieuSpil CreditAttribution: MathieuSpil commentedComment #13
MathieuSpil CreditAttribution: MathieuSpil commentedI think this ticket should be postponed after we decide on #2471791: Improve the CSS layout framework for Drupal's admin interface or we should already finish point 5 of #7. Because this will stay an issue after the new generic classes for backend pages.
Comment #14
LewisNymanI think we can still make this improvement before #2471791: Improve the CSS layout framework for Drupal's admin interface because we don't have to change the generic layout classes very much to apply them to this page and I worry that it might take a while to figure out what we want.
Comment #15
MathieuSpil CreditAttribution: MathieuSpil commentedOk, so all TODO's can now be found in #7.
Comment #16
MathieuSpil CreditAttribution: MathieuSpil commentedSetting to needs review to the patch can be properly tested before anyone starts working further on this.
Comment #18
MathieuSpil CreditAttribution: MathieuSpil commentedComment #19
MathieuSpil CreditAttribution: MathieuSpil commentedAdded a extra div so the border can be applied to the inner div.
I am also not sure if the
.entity-meta
is being used anywhere else.If not all border-specifications can also be deleted out of entity-meta.css:
Comment #20
LewisNymanIt would be better if we could use a class here like .block-list-secondary instead of a div element.
Looks like some blank white space leaked in here. I use these settings for Sublime that automatically removes whitespace https://www.drupal.org/node/1346890
Comment #21
Manjit.SinghComment #22
pjbaertThe changes made by @Manjit.Singh look correct.
Triggering the testbot.
Comment #23
MathieuSpil CreditAttribution: MathieuSpil commentedBecause the new layout-classes use padding as a way for separation, we can not use the border-left and the padding on the same element, that was why I added a extra div.
The solution of Manjit now has visual regression that looks like this (patch #21):
@Lewis: It would be better indeed without the extra div, but we can only apply a border on the elements that are inside the
.block-list-secondary
-class. And because one of them uses margin as a way to position it, we can't apply the border on that. (Or we should refactor a whole bunch of stuff.)Maybe we can add a
.block-list-secondary--inner
-class, but that seems a bit silly to me.So thanks for the tips on setting up for no more whitespace!
Assuming the patch #21 was a wrong approach because of visual regression (But not really sure), I reworked patch #19 so it no longer contains the wrong whitespace.
Comment #24
LewisNymanblock-list-secondary__inner
sounds like a good idea to me, better than adiv
Comment #25
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedAlright! Setting back to needs work
Comment #26
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedBased upon last patch, i used the
block-list-secondary__inner
-class instead of a div.Comment #27
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedAfter this ticket, the following ticket can continue: #2473213: Refactor Block CSS inline with our CSS standards.
Comment #28
LewisNymanAh sorry, it looks like it doesn't make sense to have block-list-secondary__inner if we don't use block-list-secondary. Maybe we just need to move the block-list-secondary class?
Comment #29
vijaykumar.info99 CreditAttribution: vijaykumar.info99 as a volunteer commentedHey guys,
My name is Vijay from DrupalCon LA! I just applied the latest patch from #26 to my local and we still see 3 lint errors.
Can we just convert the IDs to classes?
Thanks,
Vijay
Comment #30
vijaykumar.info99 CreditAttribution: vijaykumar.info99 as a volunteer commented-- Removing an accidentally added patch --
Comment #31
vijaykumar.info99 CreditAttribution: vijaykumar.info99 as a volunteer commentedScreenshots W.R.T the fixes I added at #30
Comment #32
vijaykumar.info99 CreditAttribution: vijaykumar.info99 as a volunteer commentedScreenshots W.R.T the fixes I added at #30
Comment #33
vijaykumar.info99 CreditAttribution: vijaykumar.info99 as a volunteer commentedHey guys,
Spoke with Lewis and he explained me that the linting errors will be handled as a part of a different issue. So now I worked on updating the files as per #28.
Please review.
Thanks,
Vijay
Comment #34
vijaykumar.info99 CreditAttribution: vijaykumar.info99 as a volunteer commentedComment #35
LewisNymanThanks for the patch! Here are the screenshots of the block placement screen on wide and narrow looking good.
Comment #36
xjmThanks everyone for your work on this issue including the screenshots.
We've got some LTR and RTL code being removed, but only one direction of padding being added. We need to have manual testing in RTL as well that's documented in the summary with before-and-after screenshots to ensure there is no RTL regression.
Comment #37
Manjit.SinghThere some changes in width of table and "Place Blocks". Please check before and after screenshots.
Comment #38
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedComment #39
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedAlright!
So thanks @manjit for the work on the screenshots.
The change in widths are caused by the use of the layout-classes that use a different amount of padding instead of using the custom padding previously defined.
The screenshots also show that all visual changes are correct. and there is no RTL-regression on the blocks.
@vijaykumar.info99
Thanks for your work on this! But I do have some feedback for you:
You should try to name your patch the same way as the last uploaded patch of the ticket. (So instead of 2335531_33.patch It should have been named replace-block-placement-page-layout-css-2335531-33.patch) This way it is easier for people working on this ticket to download your patch and apply it on their local install etc..
You should also consider adding an interdiff file so everyone up-to-date with this ticket can read the interdiff so they can see very easily what you changed since last patch.
(I added one for clarity's sake, so everyone can see you indeed incorperated Lewis his feedback in #28)
@Lewis:
Tested the latest patch too and everything looked fine indeed.
Off-topic:
In the screenshots of Manjit, you can see a rtl-regression on the menu above the blocks (too much margin-right in comparison with the LTR-screenshots)
This is the case on both the before and the after-screenshots, so is there a already a ticket about this?
Comment #40
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedComment #41
Manjit.Singh@MathieuSpil
regarding offtopic, It would be good if you can highlight that RTL margin in comparison with the LTR in screenshots.
Comment #42
alexpottI think this code means that we can remove the following code from block.admin.css
Comment #43
alexpottI think this code means that we can remove the following code from block.admin.css
Comment #44
pjbaertComment #45
pjbaertyou're right @alexpott.
Since we moved this code to system.admin.css, we can remove this part from block.admin.css
Comment #46
marieke_h CreditAttribution: marieke_h at XIO commentedThe changes suggested by @alexpott are correctly processed in #45. This can go back to RTBC.
Comment #47
idebr CreditAttribution: idebr at One Shoe commented.layout-column has no padding-right, so this line has no effect. Instead, it should be padding-left to target .layout-column + .layout-column in system.admin.css:29 with an additional override for RTL for [dir="rtl"] .layout-column + .layout-column in system.admin.css:32
Comment #48
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedHi @idebr, I think you are taking this ticket one step too far.
This ticket is mainly about implementing the layout-classes on the admin/structure/block page.
But this feedback can be posted in a follow-up ticket or a ticket dedicated to the layout-classes, or admin links-specific.
Can someone point to the correct ticket for feedback on this?
Comment #49
tim.plunkettThis can likely be closed as a duplicate after #2512456: Implement the new block layout design to emphasize the primary interaction of placing a block, unless someone things we should still genericize this
Comment #50
LewisNymanPostponing until #2512456: Implement the new block layout design to emphasize the primary interaction of placing a block lands and then let's just close this.
Comment #51
Manjit.SinghI think we can work on this issue. As #2512456: Implement the new block layout design to emphasize the primary interaction of placing a block is fixed now.
Comment #52
LewisNymanThis page no longer has a two column layout