This is a little nit picky, but being less specific (where possible) in general allows for more flexibility. I came across this one today, manually adding a <div class="messages status">...</div> to a node, and realized it wasn't styled. Sometimes these messages are printed in other places.

#messages {
  padding:20px 0 5px;
}
#messages div.status {
  background: #FCF6BE;
  border:1px solid #BBBBBB;
  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
  margin:0 auto;
  padding:15px;
  width:900px;
}
#messages div.error {
  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
  margin:20px auto;
  padding:20px;
  width:900px;
}

Would be better as:

#messages {
  padding: 20px 0 5px;
  width: 900px;
}
div.messages {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div.status {
  background: #FCF6BE;
  border: 1px solid #BBBBBB;
  margin: 0 auto;
  padding: 15px;
}
div.error {
  margin: 20px auto;
  padding: 20px;
}

Also "warning" messages don't have a Bartik style (could be by design, not sure).

CommentFileSizeAuthor
#14 removemessageswidth.patch455 bytesyoroy
#2 drupal-messages-sky.png124.5 KBJacine
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jensimmons’s picture

I just made this change and committed it to the master at GitHub.

There's no warning message, and there should be. Suggestions?

Jacine’s picture

FileSize
124.5 KB

Well, I kinda suck at design, but I can share what I am doing in the D7 version of my own theme. You are welcome to steal it if you want.

willmoy’s picture

Title: Consider being less specific with selectors in certain places » Warning messages need styling
Project: Drupal core » Bartik
Version: 7.x-dev »
Component: other » Code
Priority: Normal » Critical
Issue tags: -Bartik

Changing title to reflect the fact that what the thread was about was done.

Now we have a bartik project, moving there. Marking as critical because it seems necessary for core inclusion.

yoroy’s picture

Jacine’s picture

Yes, those would be a lot better. Nice job :D

theresaanna’s picture

I'm taking a stab at implementing those gorgeous error messages. :)

Looks straightforward so far, except that I can't find an icon that exists in D7 core to use in place of the blue icon.

yoroy, or anyone else - any ideas? Are these icons open source and available to be added into the theme?

emmajane’s picture

In theory if these messages get into core this issue becomes irrelevant because the default core style will be used. I think we should mark this issue as a duplicate of #193482: Styling status messages in system.css and focus our energy on issues that are unique to Bartik. If you agree, please go ahead and mark as dupe. :)

emmajane’s picture

Status: Active » Needs review

Please review #7 and mark this issue as duplicate if you agree this is not a Bartik-specific issue.

yoroy’s picture

Status: Needs review » Closed (duplicate)

You're absolutely right. I'll go push the one for core again. Worry about Bartik custom later if at all :)

yoroy’s picture

Title: Warning messages need styling » Do the warning messages need custom styling?
Category: bug » task
Priority: Critical » Normal
Status: Closed (duplicate) » Active

Weeeelllll… lets keep it around and let jen make a call, later.

jensimmons’s picture

I'm all for use the core messages! Let's pull any custom message code out of Bartik that should come out now. Yes?

Jacine’s picture

Status: Active » Needs review

I removed the custom Bartik styles and committed, but left the following:

#messages {
  padding: 20px 0 5px;
  margin: 0 auto;
  width: 900px;
}

I think we should remove the width here. What do you think?

emmajane’s picture

Agreed with removing the width. It's one of the fixes I had to make in the admin CSS (adjusting the width to 90% instead of 900px to have it fit in the overlay on narrower page sizes).

yoroy’s picture

FileSize
455 bytes

untested, but here's a patch

Jacine’s picture

Status: Needs review » Fixed

Great! Thank you ;) Committed.

Status: Fixed » Closed (fixed)

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