Category filter click/touch target too small, no hover styles

AI-generated summary

The discussion addresses the small click/touch targets and lack of hover styles for category filters. OlsonDev initiated the thread by noting that while the original goal was to create large touch targets, the current implementation for the ux category is too small, resembling only the badge text rather than a full row. OlsonDev suggested adding hover styles, such as a light grey background or text underline, to improve usability. sam confirmed the issue and asked for CSS suggestions, while Tom_Newsom proposed using a pale yellow background consistent with other links. OlsonDev further discussed visual considerations, including handling subcategories in the hamburger menu and ensuring contrast with category badges. After codinghorror assigned the task to Neil, codinghorror resolved the issue by changing the CSS for .badge-wrapper.bar and .badge-wrapper.bullet from margin: 5px to padding: 5px with width: 100%, effectively making the clickable area full-width like the previous “box” style.

Over a year ago, I asked for the category filter to become left aligned. I’m sure it was fixed long ago but Jeff Atwood stated:

So, what happened to that logic about having big click / touch targets? For the category ux on this meta discourse, the click target is now tiny. In the image below, the only clickable portion is the purple category badge and the letters “ux”. This doesn’t behave like a standard dropdown/<select> where an option’s click target is more akin to a row in a 1-column table. The UX could also be improved by adding a :hover style… a text underline, a background (row) color, anything would improve it.

「いいね!」 1

We were talking about this today, we definitely want to fix that tiny click target

「いいね!」 2

Awesome - what about the hover styles?

Possibly, what CSS are you suggesting? I think we should simply be consistent with what we do on the hamburger

You mean the hamburger icon itself or the icons embedded within the hamburger menu? As it stands, those categories have small click targets and no hover styles, too. Regardless, I think a light grey background would work well. I suggested an underline because if you have a light grey category badge, the light grey background might “swallow” it, which isn’t the end of the world, just not ideal. Another idea is to make the background intentionally the same color as the category badge (similar to the old version) but then you have to deal with changing the font color to achieve contrast. I don’t know if that would be difficult to maintain or if you already have something in place for that?

Ah, I didn’t realize in the hamburger menu, you list subcategories with a 50/50 colored square. So, something like would be an edge case to handle. For the hamburger menu, you’d probably want to select the most specific color and change the background to that, and then hide the badge so you don’t see a tiny rectangle of the parent category (ex: ).

I dunno… I think the light grey background would work best. :slight_smile:

Pale yellow like the other links works for me. Category colours are unlikely to be that pale due to lack of on-white contrast at small sizes, but as a solid background it’s fine.

「いいね!」 1

This is on @neil’s plate.

I was curious what pale yellow would look like behind the lightest yellow on this particular Discourse so I tried that. Then out of curiosity regarding contrast of all category badges, I just made the container pale yellow. And then the same grey as the hamburger hover. Here are the results:

Either would work for me.

I actually went ahead and took care of this since it was pretty easy.

Changed from

margin: 5px;

to

padding: 5px;
width: 100%

for .badge-wrapper.bar and .badge-wrapper.bullet – oddly enough for the old “box” category style this already worked, they were full width.

「いいね!」 6