Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
markup
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Nov 2007 at 12:11 UTC
Updated:
29 Jan 2013 at 11:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
robloachWhat's the best way to test this?
Comment #2
theborg commentedDrupal 6 pure css.
Comment #3
robloachYes, but do you have any page samples that use the .status class?
Comment #4
theborg commentedIf you use Garland theme go to style.css file and disable the styling of status messages:
Now if you go to 'admin/build/themes' and push 'save conf' you will see the status message without any style. Inspect it with firebug
Comment #5
robloachIf you're going to put it into system.css, I'd suggest taking it out of the other themes (Garland, Marvin, etc).
Comment #6
theborg commentedThe reason I put in in system.css is because the other types of messages are there, to keep some formality when there is no theme applied. Custom and core themes can provide their own styled messages.
As you can see:
Comment #7
jody lynnI think this is a good idea. I recently made a simple new theme for my site in Drupal 6 and it bugged me that I had to add .status to my css. Like theborg said, error messages are themed by default so why not have a little theming for status messages to just make them more useable.
Comment #8
moshe weitzman commentedperhaps share a screenshot?
Comment #9
theborg commentedBefore and after screenshots Garland without status messages styled, note that the colors are based on a system.css, not in Garland.
Comment #10
jody lynnComment #11
lilou commentedPatch still applied against CVS HEAD.
Comment #12
catchStill applies, good to have things consistent.
Comment #13
andypostWhy .status is gray? Maybe make them as .ok (green)?
Comment #14
theborg commented@andypost: because is a different type of message.
Comment #15
webchickHm. I would love to get a review from a few designer-eyes out there. The grey seems to clash a bit with Garland, although I understand choosing a "neutral" colour in case someone has a bright neon pink and orange theme.
Comment #16
johnalbinThe Zen theme goes with slightly bolder colors. Grey is still too drab to really draw attention, IMO.
Also, some really nice icons would help draw the eye. Again, the Zen theme has some nice ones (see the attached image), which yoroy doesn't like! lol #370419: Remove messages.css in favor of core's styling
Comment #17
robloachNow that Stark is in, it would be good to move stuff from all the other themes into system.css and make it look nice in Stark.
Comment #18
yoroy commented- The most suitable color for neutral 'for your information' messages would be a light blue. something like #e8e8ff
- Design comment? Lose the border. The background color alone defines enough of a 'box'
- Icons? Possibly, but then I'd say use the watchdog ones (or improved versions thereof :-)
All together, it would look something like this:

Comment #19
webchick#18 is a lovely, lovely thing filled with loveliness. +10,000 from me.
As a novice themer, I found it absolutely bizarre that I had to style these myself and copy/paste a bunch of crap from Garland to make my theme look relatively nice.
However, more "advanced" themers are going to want an easy way to shut this off so they can put their own styling in there instead. So probably put this styling in system-messages.css or something similar.
Comment #20
johnalbinWhere does the "OK" message come from? I only see status, warning, and error in http://api.drupal.org/api/function/drupal_set_message/7
The .ok class in drupal's stylesheets aren't related to status messages.
system-messages.css +1. That's how Zen handles it in D6. Easy to modifiy/override/remove that way.
Comment #21
geerlingguy commented+1 to #18.
Beautiful, and sorely needed. Anything that improves the 'polish' of Drupal is a godsend to me. And this does it a hundredfold!
Comment #22
yoroy commentedGood point JohnAlbin, so we skip the green one.
I cannot write the patch, but what can I do to help somebody else do it? :-)
If we want to use the icons, we should probably do that in #218674: Update watchdog-*.png status icons
These are the colors:
Comment #23
wretched sinner - saved by grace commentedComment #24
johnalbin@yoroy. It seems we have more momentum in this issue. Since any icons are better than NO message icons; and watchdog already has icons. So let's do this issue first and then do #218674: Update watchdog-*.png status icons .
I can roll a patch tonight.
I tried to use the SVG source in http://drupal.org/node/218674#comment-1249156, but neither Illustrator, Fireworks or Photoshop would open it. What's the trick to opening it? Actually, yoroy, maybe you'd better generate the individual icons and post them here. :-)
Comment #25
yoroy commentedHere they are. (The SVG source over there should work with Inkscape)
Comment #26
johnalbinIf you put the images in #25 above into the misc directory and name them error.png, info.png, and warning.png and apply this patch, you'll get… the screenshot I posted in the next comment.
Comment #27
johnalbinI mean this.
Also, I forgot to mention that the RTL style is not ideal. CSS doesn't have a way to position a background image relative to the top right corner. Specifically, you can position it exactly on the right (which this patch does), but not "5px from the right" (which this patch should do). The only crufty work-around I can see for this is to included 5 pixels of space inside the actual png files.
Comment #28
yoroy commentedWhy the borders? It's ugly, eats another few pixels of vertical space and visually kinda represents shouting to me, I really wish Drupal would stop doing that.
If you added them to prevent them from not standing out against a theme that uses a color similar to one of the backgrounds here, I'd say that's for the theme to fix/override. Why make it ugly for everyone just to prevent some edge cases from happening?
Is there a specific reason you're using px for the positioning?
I used "padding: 0.25em 0.5em 0.25em 32px;" for the div and "background-position: 8px 0.5em;" for the icon.
I wouldn't mind adding a few transparent pixels, maybe we should use that for the LTR positioning as well then.
Seems I added a bit too much gloss to the blue info icon, the one in your screengrab has a lot less contrast in the upper half then mine in #18. I'll check and re-upload using the names you used as well.
Comment #29
webchickI agree on the borders looking messy.
The bulleted lists should be aligned where the non-bulleted lists are.
Also, why aren't the icons vertically aligned?
Comment #30
yoroy commentedLeft-aligning the list items is not for stark theme to do. Any other theme would hopefully make this prettier looking indeed.
(or should we cuz we are patching system.css itself? dunno)
Peoples seemt to think the icons should align along the top.
(I don't really feel like they have to. Center vertically is certainly easier since that's default behaviour)
re: RTL alignment, on second thought I don't think we should add transparent pixels to the actual icon file. not clean and not improving re-usabiltyness.I would probably guesstimate with a horizontal 96% offset or something, but that's also sub-optimal.
Comment #31
wretched sinner - saved by grace commentedI think that system.css should be putting in sensible defaults, so that all a themer has to do is override what they don't like about the theme. Therefore I think that the left align should go in as part of this. and is overridable in themes. Realistically, most themes will want the alignment the same, so it would mean that all themes would have to duplicate this work. So from the core point of view, each core theme would have to change the alignment, probably using the same code, so we then have the same code in 3 or 4 places to maintain in future.
Also, I vote for centred icons - it seems to make more sense. The only time that I think the top align works better is if you might have multiple of one type (eg error) and were going to put the icon next to each error. Personally I think one for the area is sufficient.
Comment #32
webchickAgreed with wretched sinner. yoroy is right that it's not in stark's place to style these... in fact, it's not in stark's place to style *anything.* :) That's why they should be styled like this by default in system-messages.css. If a theme doesn't like the default styling, they just add stylesheets[all][] = system-messages.css (or whatever the syntax is) and do their own thing.
Comment #33
johnalbinBTW, the Zen issue where people asked for a top-aligned image was #308251: Add useful styling for status, warning, and error messages. Here's the screenshot of center-aligned image with 40+ messages (using Zen 6.x-1.0 message icons):
So… Is that better or worse?
Comment #34
xanoI see you guys were planning about adding info messages. If we continue with that in #375928: Add type "info" to Drupal Messenger service, we can work on the CSS issues in this issue.
Comment #35
xanoI agree that message boxes should be fully styled in a core CSS file. This is something all themes need and most will probably use the default styling anyway.
Comment #36
ejort commentedsubscribe
Comment #37
Jason Terhorst commentedComing from the design side, I need to echo the "lose the borders" comment. More visually attractive. Also works better in cases where a jQuery fade-out effect would be used.
The #18 comment is overall the best-looking solution.
Comment #38
jojototh commented+ 1 for #18 - clean, nice, clear, no borders, nice simple icons, I would close this task with that and would be totally happy with the outcome
Comment #39
shawn.sh commented+1 for #18 as well for the core base theme
Comment #40
webchickOk good. +1s all around. Now how about some folks to review/work on the patch? :)
Comment #41
andypost#18 looks nice, but whats about top-aligned?
some error messages are long so better view icons alligned at top
Comment #42
xmacinfoI'm working of rerolling this patch.
Please look at the screen shot shown with a 'status' and a 'warning'. I can't get three types of errors yet. So use Firebug to emulate the last one. :-)
Comment #43
xmacinfoHere we go. I've rerolled the patch.
I removed the message borders, leaved the icon at top left and used em instead of px.
Comment #44
xmacinfoBy the way I'm using icons in #25, but changed their name to start with "system-" instead. So those icons needs to be added as well.
Comment #45
eojthebraveI think this patch is a great idea. Having good looking default system messages is a good idea since most themes really don't need, or want to adjust the message styling. As long as they look nice to start out with then themers don't need to muck with them as much.
+ background-position: right 0.33em;should be
+ background-position: 0.33em right;as per http://www.w3schools.com/css/pr_background-position.asp
Should properties be in alphabetical order? http://drupal.org/node/302199 According to the docs they should, but that doesn't seem to be the practice in system.css as of yet.
Should we consolidate properties like this into a single line?
background: #e8eff url(../../misc/system-info.png) no-repeat 8px 0.33em; /* LTR */It seems that most places in system.css do it this way, however there are a few exceptions.
Screenshot before applying patch. Tested by calling drupal_set_message() from the devel.module php execution block, hence the extra, blank line in the 'status' message.
http://drupal.org/files/stark-before.jpg
Patch applies cleanly. Still need to download the status, error, and warning icons from #25, rename them, and place them in misc/
Screenshot after patching.
http://drupal.org/files/stark-after.jpg
Some thoughts.
Garland's CSS needs to be updated. Before and after screenshots below. The green text on a blue background should be fixed, and we should probably remove the borders, or adjust the colors so they match with the block colors.
Comment #46
xmacinfoThanks for the review. I will create an updated patch later.
We should not consolidate the properties in a single line, though. It's easier for a themer to override a single property. And it's easier to highlight which part is /* LTR */ enabled.
We need to land this patch before Garland or other themes update their CSS.
Comment #47
xmacinfoComment #48
xmacinfoForgot the status flag.
Comment #49
eojthebraveI would argue that because Garland is part of core it should be updated with this patch as well. However, as long as we are aware that this patch causes issues with Garland and can get those fixed shortly after this patch gets committed I would say this is good to go.
Point taken about easier to theme for the multi-line css properties. Though I think it would be worthwhile to make sure that all of the system.css, and similar files are using one style or the other just for consistency. At some point.
Marking as RTBC since my issues with this patch have been addressed, and I'm pretty sure we can easily fix Garland's CSS once this is committed.
Again just a reminder for anyone else reviewing committing this code, you need the error, info, and warning icons from #25, and they need to be renamed as per #44.
Comment #50
webchickLet's fix both core themes in one go, please.
Comment #51
xmacinfoPoint taken! I'll update Garland and reroll the patch.
However, please note I plan to keep the borders in Garland, which I believe are better suited when the background uses gradients.
There is no need to modify Stark since it'll use the new core css.
Comment #52
xmacinfoI changed my mind about updating Garland.
Looks like some changes will affect the color module and I don't want to break user defined colors in Garland and Minelli.
Can we ask the Garland maintainer to look at this issue?
Comment #53
dmitrig01 commentedPersonally in almost all of my themes, I split out multiple messages of the same type into separate things visually.
Comment #54
geerlingguy commented@#46 / xmacinfo: What's the main impetus for not using CSS shorthand? It dramatically reduces filesizes, is easier to read (imo as a themer), and can still be overridden by simply setting "background-color: #FFF" or whatever. Plus, FireBug and WebKit Inspector break it down anyways.
I'm +1 for using CSS shorthand... but since both ways are valid, I wouldn't make it a sticky point. Just offering my 2¢.
Comment #55
yoroy commentedCurious to see if this patch still applies
Comment #57
lilou commentedSetting to 'needs review' - testbot was broken.
Comment #59
xmacinfoWe need to ask Webchick permission to submit this patch prior any work on Garland. If she agrees to, I'll make any changes necessary to reroll this patch.
If we still need Garland to be modified as well, we need a Garland expert since I don't want to mess around in the "Don't touch" section of Garland styles.
Comment #60
xmacinfoThis may now have an impact on #484860: Initial D7UX admin theme.
Would Seven use the same system messages visual as core?
Comment #61
gábor hojtsy@xmacinfo: it is best to look at some screenshots of Seven with this proposal. Since Seven mostly uses gray variants, I doubt it wold not look right with this scheme either. Mark did not design any message colors or boxes.
Comment #62
xmacinfoThis a reroll taking into account Seven and Garland (see #50 ;-)). As for Stark it will look the same as the latest screen capture.
-> Garland now uses the system-messages.css colors and I removed the Garland message borders.
-> Seven now uses the system-messages.css colors and I removed the Seven message borders.
As for Seven, please note that Gábor told me that the messages colors where not defined by the UX theme yet. So using the default system colors should not be a bad thing for Seven. And borders for messages are a thing of the past. Let's get rid of these borders.
I think we should have Garland, Stark and Seven use the default System colors. If we really need Seven specific colors, this might as well be discussed in another issue.
Comment #63
Bojhan commentedI dont think these changes will reflect nicely on the "Seven" theme, please leave that out of this patch.
Comment #64
xmacinfoI am rerolling removing Seven from this patch. Bojhan suggest that we can open a new issue later for Seven if we need to change the display of status messages.
Comment #65
xmacinfo:-)
Comment #66
xmacinfoThis reroll is the same patch as #62, but removing Seven from the patch as suggested by Bojhan.
Please take the images in #25 to test out the complete features.
Comment #67
robloachGreat work, looks very nice.....
Should we move system-info.png, system-warning.png and system-error.png into modules/system/images/*.png so that we don't have to have the weird ../../ relative directories? It's nice to have things modular. Maybe webchick would know more.
Should these be 0px? Does "0" conform to CSS standards?
Do we still need .messages in garland's style.css?
11 days to code freeze. Better review yourself.
Comment #68
xmacinfoAbout moving images "into modules/system/images/*.png".
Well, all other Drupal core images are in /misc. There must be a good reason for this.
About 0px versus 0
Yes, when using 0 we must not display the type of unit. :-)
About "Do we still need .messages in garland's style.css?"
Unfortunately, Garland uses it and here I just remove the border.
But here is a question, do we want Seven to load the status message icons as well?
:-)
Comment #70
yoroy commentedMarked #290343: Add icons to status messages. duplicate of this.
Comment #71
xmacinfoGreat find yoroy, and thanks for these icons.
Yes, for those who cannot distinguish colors easily, we need icons to give the same type of feedback.
This patch will need a reroll since core changed quickly the last few days.
Remaining issues:
• Add the icons to seven? The reroll in #66 removed the icons for Seven.
• Use the same messages colors for Seven? #63 I was ask to remove the colors for Seven, which uses another set of messages colors. So do you prefer Seven messages colors or this issue messages colors?
As soon as I have some comments for these issues I will reroll. :-)
Comment #72
mcrittenden commentedSubscribe.
Comment #73
xmacinfo#218674: Update watchdog-*.png status icons is a duplicate of this issue, since in #25 yoroy introduces new Watchdog icons.
Comment #74
yoroy commented- I say let Seven use its own colors for messages and focus on a nicer core default for this.
- We could leave out the icons for now and re-open #218674: Update watchdog-*.png status icons for updating the *core* icons in /misc ?
(I'm collecting my icon work in http://drupal.org/project/protocons, has status icons too :-)
Comment #75
andypostI see 32 380 (current) but http://drupal.org/files/images/protocons-preview.png just 28 665 so 12% traffic improvement
+1 resonable
Comment #76
andypostGlad to see a patch before beta!!!
Comment #77
andypostAlso there's a issue #718662: DBLog listings truncate messages in the middle of HTML tags we could tune some dblog render
Comment #78
jacineCan we get a re-roll here? Not quite sure what is outstanding, and I'd like to review this. Thanks.
Comment #79
yoroy commentedRerolling but now like this:
- without icons
- not 'div.messages' but '.messages' class definitions. didn't test that thoroughly.
- previous patches used the blueish tint for status messages, changing to the green tint. Most of these messages are of the 'succes' variety anyway, "blabla has been saved" etc. The blue was looking too weak anyway.
Le screenshot:
Comment #80
jacineThanks @yoroy!
The left padding looks odd without an icon. Maybe we should remove it until we actually have icons?
I see we are not addressing Seven here, but what about Garland? Is anything needed of there?
Comment #81
yoroy commentedYup, lets drop the padding.
Must confess I didn't check Garland at all, but webchick in #50 requested we *do* incorporate any necessary Garland fixes here. Could somebody post Garland screengrabs of before and after latest patch?
Comment #82
gábor hojtsyChanges to Seven would be great to get backported to the contrib Seven D6 project once this is worked out :)
Comment #83
james.elliott commentedGarland screengrabs, ahoy!
Comment #84
xmacinfoGarland is not properly styled as seen in comment in #83. We should have the same visual as in #79 minus the left padding. :-)
Comment #85
yoroy commentedWithout padding and icon as a bg-image there's no need for a seperate RTL stylesheet anymore, right?
This patch only removes the padding, not looked at Garland yet.
Comment #86
yoroy commentednow with 100% more patch
Comment #87
xmacinfoPlease do Garland as well. :-)
Why not use the icons in #25 too? Well... until new icons are available.
Comment #88
jacineJust tested this :)
We can't remove these. Doing so breaks the password strength feedback messages, the drag and drop messages on the block listing page (the asterisk showing modified blocks is wrapped in a span.warning), and possibly more.
We need to use div.messages here, to avoid screwing the others up. Since .messages is a common class for all of these, anything that applies to all three should be in div.messages { ... }. No need to do div.messages, div.status, etc.
I don't like adding color: #000 here, but I believe it is necessary.
Regarding margins, let's only style what's absolutely necessary. Left and Right margins shouldn't be added here IMO. This should be a decision made by the theme, if needed. If we do need margins, let's make them all ems, and not mix px and ems.
Should we really style .messages ul?
142 critical left. Go review some!
Comment #89
yoroy commentedI only have a vague idea of what I'm doing here…
Comment #90
jacine@yoroy Thanks, I think this is almost ready ;) I rerolled it to add some padding and the margin-bottom back, and fix a couple of minor coding style issues.
Seven looks fine, so we just need to figure out what we are doing with Garland. It's not good the way it is, so we need to do something. Garland is applying the border colors on the messages through the color module, which is what's going on in the screenshot (attached). What should we do about that? No borders, old border colors? Do we like these new colors better for Garland? Let's figure that out so we can wrap this up.
Comment #91
xmacinfo@jacine: Nice work. But there may be reason to keep border in Garland.
Personally I would remove the borders as well in Garland. But since Garland uses a lot of gradients, message background colors without border may look awkward when displayed along Garland multiple gradients around the content area.
Is there a way to modify Garland as to not use the Color module to generate the border color?
Comment #92
yoroy commentedTo me, the best fix would be to keep Garland message styling as is; let it keep the borders, and keep its own colors.
Comment #93
aspilicious commentedWe are deleting everything in drupal.css and moving it to markup, leave it there please...
Comment #94
jacineI agree with @yoroy that it looks better the way it was. This patch gives Garland back the old colors and borders.
Comment #95
jacineNo one is willing to test? :(
Comment #96
robloachFor consistency with the Stark and Garland screenshots, here is a screenshot of it with Seven.
Comment #97
yoroy commentedSummary of what this patch does:
- move css rules for styling messages to a new system-messages.css
- apply a better looking default look to these messages.
- fixes for Garland to keep Garland's own existing look.
So, a new css file with better defaults that none of the current core themes use after all (besides Stark of course). Which is fine. Thanks all!
Comment #98
suntable for tr.warning must be superfluous.
Needs to use background-color.
Why does the same selector exist twice?
132 critical left. Go review some!
Comment #99
james.elliott commentedRerolled patch from #94
- Removed table from tr.warning selector
- Used background-color for all background attributes
- Consolidated selectors for system messages in Garland/style.css (combined div.messages and moved .messages ul and .messages li)
Comment #100
yoroy commentedNeeds review for testbot
Comment #101
jacineSorry for not responding sooner...
The reason that there are 2 entries for .messages in Garland is because one is in the color module section. Users are instructed not to edit the color section of the file so that part needs to stay the way it was in the previous patch.
Comment #102
james.elliott commentedRerolled patch from #99
- Moved div.messages margin and padding rule back to line 257
- Moved .messages ul and .messages li back to their original locations
Comment #103
jacine@james.elliott Thanks :D
The new CSS file needs to be added to the patch.
Comment #104
james.elliott commentedWhy yes, it would help to add the -N switch.
I remembered for this one :D
Comment #105
yoroy commentedAnd status :)
Comment #106
jacineGreat! Looks good to me. Thank you. :D
Comment #107
dries commentedCommitted to CVS HEAD. Thanks.
Comment #108
xmacinfoI'm writing this from an iPhone. So not verified, but I think that the new system-message.css file have not been committed. Can someone verify this?
Comment #109
xmacinfoConfirmed:
“modules/system/system-messages.css” is missing from “http://drupal.org/cvs?commit=349090”.
Comment #110
sunSo we need core maintainer attention.
Comment #111
rfayIn case anybody is being completely baffled by their Eclipse debugging being completely broken by this commit:
You can prevent eclipse from repeatedly continuing on in a debugging loop with
touch modules/system/system-messages.cssuntil the missing file is committed.
I have no idea why a missing CSS file would completely ruin a debugger.
But another triumph for "git bisect".
Comment #112
webchickCommitted missing CSS file.
That's wild that that breaks Eclipse so badly. Huh.
Comment #114
codingforever99 commentedLooks good, thanks for all.
Comment #115
xano