Size of notifications/alerts badge

Gorbles

Load Balanced
Joined
Nov 24, 2014
Messages
11,893
Location
UK
Sorry, I don't know if this has been answered already, in a bit of a rush. But based on reading the styling guide thread, it looks like user-end CSS tweaks (without using something third-party like Stylish) are out-of-bounds, it's all palette-based stuff.

If that's true, is there anything that can be done with the readability of the notifications / alerts badge? I have a rather mainstream 1080p resolution and it is nigh-unreadable at a glance (this is a 5):

1659543816163.png
 
We can do CSS alterations. The main issue with the number at the bell icon is that I've not been able to figure out which element the number is. Everything what I've tried so far resulted in the whole bell being enlarged, which has some not-so-nice effects on the whole navigation bar.
If you have some skills in this area, and could identify which element it must be, then this would be greatly appreciated.
 
We can do CSS alterations. The main issue with the number at the bell icon is that I've not been able to figure out which element the number is. Everything what I've tried so far resulted in the whole bell being enlarged, which has some not-so-nice effects on the whole navigation bar.
If you have some skills in this area, and could identify which element it must be, then this would be greatly appreciated.
The pseudo-selector is:

.p-navgroup-link.badgeContainer:after

You should be able to tweak everything from there (including a negative margin-top to move it further up independently of the alert icon). It'll likely also affect the notifications on the conversations inbox as well (which would be ideal, I just don't have any so I haven't noticed it).
 
It's a bit top-heavy. I was investigating it myself (XenForo decided to read my notifications for me while I was messing around with selectors, so I lost them). What we need is vertical-align, and the pseudo-element should be inline-block, but in Chrome it appears to be being computed as a block (which means vertical-align will have no effect).
 
I figured, therefore I changed the line hight a bit. For me looks fine, but I don't know how it looks in other screen resolutions.
Got it, I think. Can ignore the vertical-align and whatever else, not sure why it's not being respected, but hey.
  • Reduce line-height to 9px (this pulls the text up).
  • Set the height to 1em (the pixels will calculated, but 1em should scale nicely).
 
With only:
line-height: 9px;
height: 1em;

I get

line_height_height.png


Which doesn't look too much different from before, I'm afraid.

If I also set the font-height to 15px (as right now), then the font will (obviously) reach out of the 9px line height.
 
The J, have you tried changing the font size, too? In extra.less I've got:

Code:
.p-navgroup-link.badgeContainer:after
{
    font-size: 120%;
    line-height: 15px;
    height: 1em;
}

And I get:
Notifications.png


Edit: failed to specify which template my edit was in.
 
And this is it on Firefox (had to hack the pseudo-selector in because I don't actually have one right now - turns out that's easier on Firefox than in Chrome. Neat).

EDIT

Yeah, it's not a lot bigger, but it's at least readable now.

We can crank it up though. font-size: 16px works with line-height: 11px (keeping height at 1em), with my testing. I've attached how that looks (on Firefox) as well.
 

Attachments

  • firefox-notification-1.png
    firefox-notification-1.png
    70 KB · Views: 15
  • firefox-notification-2.png
    firefox-notification-2.png
    52 KB · Views: 16
Not sure if you've changed anything since your last screenshot, The J, but I'm seeing pretty much the same thing here as in my screenshot (Windows 10 / Firefox latest / 1920x1080). IMHO it looks fine.
 
I'm on a 4k screen and will check as soon as I get an alert. hint hint
 
Top Bottom