mi6 / mi6/ic-ui-kit

Secondary Button with Link Monochrome colour incorrect

Open
#4,115 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

### Summary of the bug
When using a secondary button that has a link inserted, if the monochrome attribute is applied, the color attribute isn't overridden in the CSS rules.
Most notably this is causing these buttons used in a hero component to have poor contrast ratio.
I have a suspicion that this is related to, or the fix could be collocated with that for #4038, but is a separate issue.

### 🪜 How to reproduce
1. create a button
2. add an anchor element to the button using the "router-item" slot
3. set the variant to "secondary"
4. Set the monochrome attribute (or nest the button within a hero or similar)
5. See that the button stays coloured
### 📸 Screenshots or code

Image
https://stackblitz.com/edit/1f2eihpk?file=index.html

### 🧐 Expected behaviour
When monochrome is used on a button, the colour of that button should change to be either white or black to give as much contrast as possible.

### 🚨 Urgency (low, medium or high)
Medium

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the linked StackBlitz example using a secondary button with the router-item slot and monochrome enabled. Inspect the button styling and compare it with the related issue #4038; done means the button's colour becomes white or black with sufficient contrast when monochrome is applied, including inside a hero component.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.