Problem/Motivation

When you have a div in a fieldset with the class container inline all divs and labels get a display: inline.
On divs this breaks some style like margin and padding.

Proposed resolution

The proposed resolution applies the supplied patch to all divs that have the class .container-inline and sets the display style to inline-block.

Remaining tasks

From comment #5:
Search through core files to find instances of "container-inline" to find where this markup is used. Then take screenshots of as many of these instances as possible to make sure we are not visually breaking anything with this change.

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Embed before and after screenshots in the issue summary Novice Instructions Completed

Original report by @Oostie

When you have a div in a fieldset with the class container inline all divs and labels get a display: inline.
On divs this breaks some style like margin and padding.

This patch sets inline-block on divs.

CommentFileSizeAuthor
#77 container-inline.patch749 bytesagrozyme
#71 search.png29.98 KBankitasharma13
#68 divs_in_the-2226317-67.patch526 bytesmanuel garcia
#63 divs_container_inline-2226317-63.patch1.25 KBjoginderpc
#63 fixed-issue.png6.38 KBjoginderpc
#62 after_patch.png7.75 KBjoginderpc
#62 before_patch.png10 KBjoginderpc
#59 divs_in_the-2226317-59.patch1.05 KBmanuel garcia
#55 after_bartik.png70.2 KBstudiozut
#55 before_bartik.png72.06 KBstudiozut
#49 divs_in_the-2226317-49.patch1.63 KBmanuel garcia
#47 Error.png10.49 KBdbjpanda
#43 after.png117.57 KBalexpott
#43 before.png116.26 KBalexpott
#39 container-inline-css-2226317-39.patch2.51 KBlewisnyman
#39 interdiff.txt2.57 KBlewisnyman
#29 container-inline-css-2226317-26.patch519 bytesGemVinny
#26 container-inline-css-2226317-25.patch518 bytesGemVinny
#24 container-inline-css-2226317-24.patch448 bytesGemVinny
#24 search-box-after-patch24 copy.png56.81 KBGemVinny
#24 search-box-before.png56.81 KBGemVinny
#24 search-box-after.png54.1 KBGemVinny
#24 published-date-content-type-ui-before.png77.74 KBGemVinny
#24 published-date-content-type-ui-after.png82.72 KBGemVinny
#24 date-content-type-ui-before.png57.35 KBGemVinny
#24 date-content-type-ui-after.png62.83 KBGemVinny
#24 authored-on-content-type-ui-before.png82.99 KBGemVinny
#24 authored-on-content-type-ui-after.png90.51 KBGemVinny
#24 author-content-type-ui-before.png68.14 KBGemVinny
#24 author-content-type-ui-after.png67.29 KBGemVinny
#22 container-inline-css-2226317-22.patch488 bytesjuho.lehmonen
#21 2226317--view-settings--after.png31.17 KBamanire
#21 2226317--view-settings--before.png28.68 KBamanire
#21 2226317--datetime-form--after.png29.03 KBamanire
#21 2226317--datetime-form--before.png27.86 KBamanire
#21 2226317--comments-update-options--before.png25.64 KBamanire
#21 2226317--comments-update-options--after.png26.79 KBamanire
#21 2226317--create-advanced-action--after.png28.69 KBamanire
#21 2226317--create-advanced-action--before.png27.55 KBamanire
#20 after-search-page-form.png19.03 KBibbwebguy
#20 before-search-page-form.png18.28 KBibbwebguy
#19 after--search-block-search-module.png8.17 KBibbwebguy
#19 before--search-block-search-module.png8.03 KBibbwebguy
#18 after--admin-config-search-pages.png38.71 KBibbwebguy
#18 before--admin-config-search-pages.png36.96 KBibbwebguy
#17 after--inline-block-views-admin-ui-dropdown-2.png140.92 KBaczietlow
#17 before--inline-block-views-admin-ui-dropdown2.png158.68 KBaczietlow
#17 after--inline-block-views-admin-ui-dropdown.png133.45 KBaczietlow
#17 before--inline-block-views-admin-ui-dropdown.png146.51 KBaczietlow
#1 after.png18.46 KBoostie
#1 before.png17.77 KBoostie
inline-block.patch440 bytesoostie

Comments

oostie’s picture

StatusFileSize
new17.77 KB
new18.46 KB
oostie’s picture

Version: 8.0-alpha10 » 8.x-dev
lauriii’s picture

Status: Active » Reviewed & tested by the community

Tested and fixes the issue.

star-szr’s picture

Status: Reviewed & tested by the community » Needs review

@webchick mentioned this issue in IRC, I think we'll need more screenshots because the .container-inline wrapper is used all over the place, including in Views.

star-szr’s picture

Issue tags: +Needs screenshots

It turns out the screenshots here are from Views, oops!

Searching through core to find instances of "container-inline" will help to find where this markup is used, it would be nice to find and take screenshots of as many of those as possible and make sure we're not visually breaking anything with this change.

(See also #2099579: Discuss automated visual regression testing)

emma.maria’s picture

Issue summary: View changes
Issue tags: +Novice, +frontend
emma.maria’s picture

Issue summary: View changes
themusician’s picture

Issue summary: View changes
themusician’s picture

Issue summary: View changes

Comment tags were not rendered in the summary update so I have removed the inapplicable sections in prep for the Austin sprint.

amanire’s picture

I'll review this patch and take some screenshots now.

ericski’s picture

Status: Needs review » Needs work

I applied the patch, the patch applied cleanly, but didn't seem to make any difference (cache was cleared). The fix appears to already be in core.

arkiii’s picture

Assigned: Unassigned » arkiii
arkiii’s picture

Assigned: arkiii » Unassigned
aczietlow’s picture

Assigned: Unassigned » aczietlow

I'm going to take an attempt at this.

ibbwebguy’s picture

Working on issue for Austin DrupalCon Sprint.

Did a search of the core directory and found the following files to review:

$ find core -type f -exec grep -l "container-inline" {} \;
core/modules/action/src/Form/ActionAdminManageForm.php
core/modules/comment/src/Form/CommentAdminOverview.php
core/modules/datetime/datetime.module
core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php
core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
core/modules/dblog/src/Form/DblogFilterForm.php
core/modules/editor/editor.admin.inc
core/modules/editor/src/Form/EditorImageDialog.php
core/modules/field/src/Plugin/views/field/Field.php
core/modules/field_ui/src/Form/FieldEditForm.php
core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
core/modules/locale/src/Form/TranslateFilterForm.php
core/modules/path/src/Form/PathFilterForm.php
core/modules/search/search.module
core/modules/search/src/Form/SearchPageForm.php
core/modules/search/src/SearchPageListBuilder.php
core/modules/simpletest/src/Form/SimpletestResultsForm.php
core/modules/system/css/system.module.css
core/modules/system/css/system.theme.css
core/modules/system/src/Plugin/views/field/BulkForm.php
core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
core/modules/views_ui/admin.inc
core/modules/views_ui/css/views_ui.admin.theme.css
core/modules/views_ui/src/Form/Ajax/AddHandler.php
core/modules/views_ui/src/ViewAddForm.php
core/modules/views_ui/views_ui.theme.inc
core/themes/seven/seven.theme

aczietlow’s picture

I confirmed the above list
grep -rl 'container-inline' core/

ibbwebguy’s picture

Instances at admin/config/search/pages

ibbwebguy’s picture

Search block:

core/modules/search/search.module

ibbwebguy’s picture

StatusFileSize
new18.28 KB
new19.03 KB

Found an instance where it breaks the UI.

This in the Search Page Form: core/modules/search/src/Form/SearchPageForm.php

amanire’s picture

juho.lehmonen’s picture

Assigned: aczietlow » Unassigned
Status: Needs work » Needs review
StatusFileSize
new488 bytes

Here is a patch changing "display:inline" to "display:inline-block".

GemVinny’s picture

Assigned: Unassigned » GemVinny
Issue tags: +FUDK
GemVinny’s picture

I have been testing this - the one bug I noticed was on the search form. I have created a patch to fix this. I have added screen shots to show before/after I applied patch #22 as well as a screen shot with my fix.

Status: Needs review » Needs work

The last submitted patch, 24: container-inline-css-2226317-24.patch, failed testing.

GemVinny’s picture

Assigned: GemVinny » Unassigned
StatusFileSize
new518 bytes

New patch that isn't corrupt :)

rteijeiro’s picture

Status: Needs work » Needs review

Let's see what the testbot says ;)

rteijeiro’s picture

Status: Needs review » Needs work
+++ b/core/modules/system/css/system.module.css
@@ -264,6 +264,10 @@ tr .ajax-progress-throbber .throbber {
+.container-inline .form-type-search{

Missing space before opening curly bracket.

GemVinny’s picture

Status: Needs work » Needs review
StatusFileSize
new519 bytes

Third time lucky!

rteijeiro’s picture

Status: Needs review » Reviewed & tested by the community

It's RTBC for me. Go testbot go!

Congrats @lilGemVinny for your first contribution and thank you so much ;)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 29: container-inline-css-2226317-26.patch, failed testing.

Status: Needs work » Needs review
themusician’s picture

Status: Needs review » Reviewed & tested by the community

Bot failure? Looks good still.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 29: container-inline-css-2226317-26.patch, failed testing.

lauriii’s picture

Status: Needs work » Reviewed & tested by the community

Test bot you're drunk, go home!

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/modules/system/css/system.module.css
@@ -264,6 +264,10 @@ tr .ajax-progress-throbber .throbber {
+/* Inline search form */
+.container-inline .form-type-search {
   display: inline;
 }

Are we sure this is the correct approach?

Perhaps we need to adjust bartik's search form styling?

thamas’s picture

Issue summary: View changes
Issue tags: -Needs screenshots, -Novice, -FUDK +Amsterdam2014

I removed the Novice tag cause this issue needs a decision and has no novice task now.

lewisnyman’s picture

StatusFileSize
new2.57 KB
new2.51 KB

Thanks Alex, good point. Here's a screenshot of the search form in Stark without the code:

.container-inline .form-type-search {
display: inline;
}

Only local images are allowed.

So it looks like we don't need this code to sit in system. It can sit in Bartik. Here's an updated patch. I also noticed that the ID selector for Bartik was totally wrong so I had to update that as well.

alvar0hurtad0’s picture

Status: Needs review » Reviewed & tested by the community

It seems it works.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Well now the search form styling has changed. I think we need need a separate issue for search block styling in bartik and we should only fix the inline-ness here. If you have two search blocks on the same page in bartik they have different buttons - lol.

lewisnyman’s picture

Status: Needs work » Reviewed & tested by the community

Ok, in that case the simplest fix is the patch previous to mine. Marking #29 back to RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new116.26 KB
new117.57 KB

I'm really concerned that this patch is going to introduce visual inconsistencies all over the place. See the before and after of the node type vertical tabs. Yes "Authored on" with the patch now has padding but none of the other form elements do making this look really inconsistent.

lewisnyman’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Needs work » Postponed

Maybe the only sensible thing to do is to postpone it to 8.1.x at this stage? The risk for regression is very high here.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

emma.maria’s picture

Status: Postponed » Needs work
Issue tags: -Amsterdam2014 +CSS, +Needs manual testing, +Needs screenshots, +Needs reroll

Opening this baby back up!

dbjpanda’s picture

StatusFileSize
new10.49 KB

error
Why i am getting this error even after " git pull " . Do i need to manually copy these folders from 8.0.x or what ? Can any one help me please.
Also there is no vendor folder in 8.2.x. Most of the time i am getting this type of error while trying to work with 8.2.x.

manuel garcia’s picture

Assigned: Unassigned » manuel garcia

Rerolling...
@dbjpanda that means that the patch you are trying to apply is trying to make changes to files that are no longer there. This is mainly because of the changes that happened since the patch was created. See https://www.drupal.org/patch/reroll for how to reroll patches ;)

manuel garcia’s picture

Assigned: manuel garcia » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.63 KB

Here is the reroll.

The patch is much smaller because the search form is now properly styled on bartik/css/components/search-form.css, so I believe those changes were no longer necessary.

lauriii’s picture

Issue tags: -Needs reroll
joelpittet’s picture

Issue tags: +Novice

We may not be able to change stable here but the rest looks great. Could use a few screenshots to see if it breaks anything but in general this makes some of the block attributes like width, padding, margin etc work as expected.

studiozut’s picture

Taking a look. NOLA DrupalCon sprint. Will run a fresh grep and some updated screenshots.

studiozut’s picture

grep -rl 'container-inline' core/ (on 8.1.1)
core/modules/comment/src/Form/CommentAdminOverview.php
core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeWidgetBase.php
core/modules/action/src/Form/ActionAdminManageForm.php
core/modules/simpletest/src/Form/SimpletestResultsForm.php
core/modules/system/css/components/container-inline.module.css
core/modules/system/system.libraries.yml
core/modules/system/src/Tests/Asset/LibraryDiscoveryIntegrationTest.php
core/modules/system/src/Plugin/views/field/BulkForm.php
core/modules/system/tests/themes/test_theme/test_theme.info.yml
core/modules/search/src/SearchPageListBuilder.php
core/modules/search/src/Form/SearchPageForm.php
core/modules/views_ui/css/views_ui.admin.theme.css
core/modules/views_ui/views_ui.theme.inc
core/modules/views_ui/src/Form/Ajax/AddHandler.php
core/modules/views_ui/src/ViewAddForm.php
core/modules/views/src/Plugin/views/field/Field.php
core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
core/modules/node/node.module
core/modules/locale/src/Form/TranslateFilterForm.php
core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php
core/modules/dblog/src/Form/DblogFilterForm.php
core/modules/editor/editor.admin.inc
core/modules/editor/src/Form/EditorImageDialog.php
core/modules/path/src/Form/PathFilterForm.php
core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
core/themes/bartik/templates/block--search-form-block.html.twig
core/themes/stable/css/system/components/container-inline.module.css
core/themes/stable/css/views_ui/views_ui.admin.theme.css
core/themes/stable/stable.info.yml
core/themes/seven/css/components/search-admin-settings.css
core/themes/seven/seven.theme
core/themes/classy/classy.libraries.yml
core/themes/classy/templates/block/block--search-form-block.html.twig
core/themes/classy/templates/form/datetime-form.html.twig
core/themes/classy/css/components/container-inline.css

studiozut’s picture

Assigned: Unassigned » studiozut
studiozut’s picture

Issue summary: View changes
StatusFileSize
new72.06 KB
new70.2 KB

I agree with @alexpott, this introduces style inconsistencies that may be a problem given how many places the .container-inline class appears. I'm including a more recent before/after where you can see the change (Bartik) in the 'authored on' fields.
screenshot
screenshot

manuel garcia’s picture

Status: Needs review » Needs work

Thanks @studiozut for that!

studiozut’s picture

+++ b/core/themes/bartik/css/components/header.css
@@ -165,10 +165,10 @@
+.region-header #search-block-form .form-text {

From the divs_in_the-2226317-49.patch, lines 169 and 172: I'm not sure why this is part of the container-inline issue, maybe it should be addressed separately?

studiozut’s picture

Assigned: studiozut » Unassigned
manuel garcia’s picture

StatusFileSize
new1.05 KB
+++ b/core/themes/bartik/css/components/header.css
@@ -165,10 +165,10 @@
-.region-header #block-search-form {
+.region-header #search-block-form {
...
-.region-header #block-search-form .form-text {
+.region-header #search-block-form .form-text {

I agree that this is out of scope for this issue, it was there before so I re-rolled it without giving it much thought. I have now removed them from this patch.

I agree that there're going to need to be a lot of adjustments across the board to make the change towards inline-block. Starting funnily enough with the search block which is broken with this patch.

#block-search-form is no longer, and now the form has an id of #search-block form. So those lines should probably be removed from there since they do nothing, a nice novice issue ;)

Vidushi Mehta’s picture

Status: Needs work » Needs review
manuel garcia’s picture

Status: Needs review » Needs work

Latest patch should be the starting point, next steps would be:

1. Identify everything that breaks visually with this change
A good starting point might be double checking the files that use this (#53), and see where these are displayed to check for inconsistencies.

2. Fix it.

joginderpc’s picture

Assigned: Unassigned » joginderpc
StatusFileSize
new10 KB
new7.75 KB

There are several issues being created after applying the patch #59. This is making many of the Divs inline-block where this is not necessary.

Screen shot attached please check.

before applying patch

after applying patch

joginderpc’s picture

Assigned: joginderpc » Unassigned
Status: Needs work » Needs review
StatusFileSize
new6.38 KB
new1.25 KB

Updated new patch with fixing the issue pointed in earler comment #62. Added new line for search form which fixed the alignment breaking issue.

issue fixed

ankitasharma13’s picture

Status: Needs review » Reviewed & tested by the community

now its working fine tested by applying above patch.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

I don't think we can make the change like this at this point in the Drupal 8 cycle as it might break contrib and custom themes that have extended classy or stable. We shouldn't be making this change to stable. The question is should we be making this change to core's CSS. I'm going to ping @Cottser for an opinion.

star-szr’s picture

Yep I agree with @alexpott, we can't change Stable or Classy for this. We can change the core CSS, Bartik, and Seven.

Removing the screenshot and manual testing tags until we have a new patch to test.

urvigala’s picture

Assigned: Unassigned » urvigala
manuel garcia’s picture

Status: Needs work » Needs review
Issue tags: +Needs manual testing, +Needs screenshots
StatusFileSize
new526 bytes

@Cottser, @alexpott you're right of course - previous patch was changing stable...

Here is a patch that only changes core's css.

So this patch should have no visual regressions, since both Bartik and Seven have classy as base theme, classy's base theme is the default which is stable, and stable overrides this change.

urvigala’s picture

Assigned: urvigala » Unassigned
joginderpc’s picture

@cottser Sorry my miss, written code in theme not in core.

ankitasharma13’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new29.98 KB

Applied patch and manually tested.Its working fine.

star-szr’s picture

Assigned: Unassigned » star-szr
star-szr’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs manual testing, -Needs screenshots

inline-block makes sense for something called container-inline. Too risky to commit to core themes but a good change for core CSS itself.

Committed 40136a9 and pushed to 8.2.x. Thanks!

  • Cottser committed 40136a9 on 8.2.x
    Issue #2226317 by GemVinny, Manuel Garcia, joginderpc, Oostie,...
chi’s picture

Status: Fixed » Closed (fixed)

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

agrozyme’s picture

StatusFileSize
new749 bytes

in Drupal 8.6.9
not fix /core/themes/stable/css/system/components/container-inline.module.css

jwilson3’s picture

@agrozyme, ^ that should probably be opened as a new issue against core , ideally with screenshots showing the error in the search form.