Problem/Motivation

The left edge of the messages is misaligned.

Proposed resolution

Simple: align the messages correctly. #2277427 was doing the exact same thing. I closed this issue, to make sure we're only doing this once.
Before:

After:

Remaining tasks

- Get the patch from #2277427 and apply it here.
- Make sure the patch works, and that it supports both ltr and rtl languages.

User interface changes

The left egde of the messages is aligned with the content.

API changes

None.

Original report by @droplet

Left edge is misaligned

Before:

After:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Oostie’s picture

It looks like this patch has already been committed to core, is that correct?

droplet’s picture

Nope, not yet

Bojhan’s picture

Status: Needs review » Reviewed & tested by the community

Interesting, seems to work.

  • Commit eedb6a8 on 8.x by webchick:
    Issue #2220905 by droplet: Misaligned messages status.
    
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

mcjim’s picture

Status: Fixed » Needs work
FileSize
53.63 KB

Warning and error messages also need to be aligned.
It might be better to follow Bartik's example add the margin to .messages rather than the individual .messages--[type] classes.

droplet’s picture

@mcjim,

what is your browser and theme. I wonder why 2nd & 3rd are aligned well (without applying fixes). ( I assumed there're sharing same code )

droplet’s picture

Status: Needs work » Needs review
FileSize
1.14 KB
mcjim’s picture

That screenshot was from Safari 7.0.2 and Seven theme, and yes it's awkwardly different to everything else! I can have a look into that if you don't have access to a Mac.

droplet’s picture

FileSize
109.13 KB

Yes, please. It's my Mac screenshot, same errors.

mcjim’s picture

You can ignore my comment about Safari. I was being an idiot and had a couple of patches on the go…
Just waiting for the coffee to kick in and I'll review your latest patch :-)

mcjim’s picture

Status: Needs review » Needs work
Related issues: +#2213583: Misaligned Icons in Drupal 8.x
FileSize
25.52 KB
25.4 KB
46.71 KB

OK, patch is looking good in Seven, except for the node/add pages.
#console has 2em of margin in core/themes/seven/style.css, which was added in #2095275: Space above add content form with no overlay. I'm not sure of the consequences of removing it.

LewisNyman’s picture

Let's get rid of the 2em margin. I think it was only introduced to attempt to fix the messages placement.

mcjim’s picture

I've been thinking about this and the alternative approach to lining-up taken in #2213583-31: Misaligned Icons in Drupal 8.x, which adds margin to #console in core/themes/seven/style.css, instead.

I think I'm in favour of this, as it's theme-specific, and the lining-up should be theme-specific. Removing the margin on .messages in system.theme.css will mean less to override in custom themes.

So it might be best to roll back the commit in #5 and work on refining #2213583: Misaligned Icons in Drupal 8.x, instead (sorry!).

The only problem I'm aware of at the moment will be the AJAX error pages, where the messages are printed out as the main content of the page and not in #console, so we would need to add margin elsewhere to line those up (in Seven, at least).

Manjit.Singh’s picture

I have applied a patch manually, Messages are aligned now. Refer screenshots

Sumit kumar’s picture

#8
I had tested this patch on my local machine .But its not working

Sumit kumar’s picture

Assigned: Unassigned » Sumit kumar
Status: Needs work » Needs review
FileSize
21.9 KB

line no.- 1105
File:- views_ui.admin.theme.css

we can add this code for alignment of error.

div.messages {
margin-left: 8px;
}

LewisNyman’s picture

Issue tags: +CSS, +frontend
emma.maria’s picture

Assigned: Sumit kumar » Unassigned
Status: Needs review » Needs work
Issue tags: -CSS, -frontend

Resetting this to needs work as the things discussed in #13 and #14 were not implemented.

It would be good to get fresh opinions from @lewisnyman and @mcjim on the next steps for this patch as things wandered off a bit.

Also tag with Novice if it's nice and straight forward please :)

emma.maria’s picture

Issue tags: +CSS, +frontend
jaredsmith’s picture

Gábor Hojtsy’s picture

Also found in #2318381: Message not styled properly on interface translation page , descoped from there in favor of this issue.

pbz1912’s picture

pbz1912’s picture

There is a patch on #2277427: Messages are not aligned. (12) that may help this issue.

GemVinny’s picture

This issue still needs a summary update about what needs to happen :)

sqndr’s picture

Issue summary: View changes
sqndr’s picture

Updated the issue summary, so removing the tag. Also adding the RTL tag.

sqndr’s picture

Here's the patch from #2277427.

G-raph’s picture

Assigned: Unassigned » G-raph
Status: Needs work » Needs review
G-raph’s picture

Assigned: G-raph » Unassigned
jaredsmith’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed... this looks sane to me.

rteijeiro’s picture

Status: Reviewed & tested by the community » Needs review

@jaredsmith, could you provide some screenshots and the browsers you used to check it, please?

Status: Needs review » Needs work

The last submitted patch, 28: misaligned-messages-#2220905-28.patch, failed testing.

skippednote’s picture

FileSize
81.14 KB
69.73 KB
43.19 KB

The message boxes are looking fine in Seven however there is an alignment issue in Bartik.

Current message box in Bartik

Attached are the screenshot fixed message boxes

skippednote’s picture

Status: Needs work » Needs review
FileSize
375 bytes

Since the box-shadow doesn't transform layout the box-shadow is bleeding to the left and not pushing message box with it.

margin: 8px 15px 8px 23px;
15px margin + additional 8px for the box-shadow being applied to message box

skippednote’s picture

FileSize
32.54 KB
21.72 KB

Screenshots after applying patch:

LewisNyman’s picture

Status: Needs review » Needs work

I can confirm that it looks great in LTR, but I found this in Bartik in RTL

LewisNyman’s picture

herom’s picture

Status: Needs work » Needs review
FileSize
513 bytes
503 bytes
41.14 KB

Fixed the RTL issue.

Misaligned message - RTL fixed

jaredsmith’s picture

Status: Needs review » Reviewed & tested by the community

I've reviewed this as well, and it looks good in both regular and RTL. I think it's ready to be committed.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 3e53bf2 and pushed to 8.0.x. Thanks!

Added the LTR comment on commit.

diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css
index 1e53eb6..fcdebc1 100644
--- a/core/themes/bartik/css/style.css
+++ b/core/themes/bartik/css/style.css
@@ -1372,7 +1372,7 @@ div.tabs {
   background: rgba(30, 50, 10, 0.08);
 }
 div.messages {
-  margin: 8px 15px 8px 23px;
+  margin: 8px 15px 8px 23px; /* LTR */
 }
 [dir="rtl"] div.messages {
   margin-right: 23px;

  • alexpott committed 3e53bf2 on 8.0.x
    Issue #2220905 by droplet, herom, skippednote, sqndr: Fixed Misaligned...
skippednote’s picture

Status: Fixed » Closed (fixed)