mi6 / mi6/ic-ui-kit

[ic-top-navigation, ic-badge] ic-badge colour in mobile view (inline)

Open
#3,166 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

## Summary of the bug
Now that the badge is inline in mobile view when in top navigation it needs to render as a different colour to have enough contrast.

Designers - do we need a way to calculate different colour values when the badge is slotted in a navigation button, or keep it simple with an opinionated red notification colour?

It's easy enough to set the variant as light when in desktop and neutral when in mobile using the nav menu listeners in `ic-badge.tsx`, but the dark badge next to a tertiary default button didn't look quite right.

## Default

![Image](https://github.com/user-attachments/assets/d63b256f-47b4-44c5-b6b7-a8e39354dae3)
![Image](https://github.com/user-attachments/assets/01f11531-d0a8-416b-873e-f164d9349cab)

## Desktop `variant="light"`

![Image](https://github.com/user-attachments/assets/dffc396e-a09d-406a-891c-71489b71a9c8)
![Image](https://github.com/user-attachments/assets/a36526e9-2f89-4361-b872-224591f79087)

## Current fix set in `ic-badge.tsx`

![Image](https://github.com/user-attachments/assets/5b1b972a-5434-410e-8f60-391428e6792a)
![Image](https://github.com/user-attachments/assets/cf53a9c2-48ed-43ee-9c17-0aa2e8eb46e5)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ic-badge.tsx and inspect the nav menu listeners that set badge variants for desktop and mobile. Compare the documented default, desktop, and current-fix screenshots, then confirm the intended contrast treatment with the design direction; done means the inline mobile badge has an approved readable colour without harming the desktop or button appearance.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
design, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.