Chip / Badge no longer have proper support for anchors
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 30/100
Direzione di ricerca
Start with the linked CodePen reduced test case, which compares a chip, a badge, and a badge with a btn variant wrapping an a element. The payload does not name source files, so first find the badge and chip styles in the SCSS. Maintainers have not yet decided whether anchor support should return or the docs should show btn-subtle or btn-solid, so confirm that direction before editing. Done means a clickable badge or chip shows a visible hover and focus state, with a docs example.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Prerequisites
- I have searched for duplicate or closed issues
- I have validated any HTML to avoid common problems
- I have read the contributing guidelines
Describe the issue
Hey guys,
While porting my UI from Boostrap v4 to Bootstrap v6, I've noticed that we've lost support for anchors on badge, and / or the new chip elements.
The docs have no examples on how to use badges or chips with anchors.
❌ resolved via: https://github.com/twbs/bootstrap/pull/43300chip does not allow navigation / focus (?!) on an anchor element.
❌ badge has no hover state when applied on an anchor (the only visual cue is the cursor hand).
My understanding is that badge have turned to a decoration only element.
In my opinion, this is a mistake, there are legitimate use cases for badges where you want a supporting element to also be clickable, e.g: when used inline to describe a software version, when used under an article as anchor tags, etc.
Some of the largest CSS frameworks / libraries have this feature:
✅ Shadcn UI badge link: https://ui.shadcn.com/docs/components/base/badge#link
✅ Catalyst UI badge link (made by Tailwind's Team): https://catalyst.tailwindui.com/docs/badge#using-as-links
✅ Flowbyte UI badge link: https://flowbite.com/docs/components/badge/#badges-as-links
✅ Antdesign UI badge link: https://ant.design/components/badge#badge-demo-link
✅ Boostrap v4 badge link: https://getbootstrap.com/docs/4.6/components/badge/#links
and the list could continue...
What seems to restore the old Bootstrap v4 behavior is adding a "btn-subtle" or "btn-solid" class to the badges. I don't think this was the intended way to use for links, and if that is indeed the intended case, then perhaps a Links section to the badges components should be included as an example in the docs (I could open a PR for this if confirmed).
A real world example you can see is in my software, where Spaces are sort of a "label" (similar with those on macOS for example), and have different colors to be easily recognisable, and are clickable in order to be filtered by (this could also have been a tags section of a blog post, or whatever other use cases there may be).
I've included a reduced test case where you can see all three variants (chip, badge, badge + btn-variant).
Reduced test cases
https://codepen.io/editor/pricop/pen/01a1d522-237f-78bc-b600-898ac6d3d977
What version of Bootstrap are you using?
v6
- Lingua principale
- JavaScript
- Stelle
- 175k
- Fork
- 78.9k
- Merge medio
- 4g 2h
- PR unite (30g)
- 89
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di twbs/bootstrap
-
v6: Minified bootstrap.min.css is missing header infoForse già presa @lazerg l’ha presa oggi. Apertabug build confirmed has-pr v6
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Regression in v6.0.0-alpha.2: fly-out submenus shrink to `min-width`Forse già presa @keshav-hue l’ha presa oggi. Apertabug confirmed css has-pr regression v6
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
twbs/bootstrap#43494 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
css docs feature js v6
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
twbs/bootstrap#43488 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug confirmed css has-pr v6
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
twbs/bootstrap#43484 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug confirmed css has-pr v6
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
twbs/bootstrap#43483 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di twbs/bootstrap
Issue simili
-
accessibility bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quarto-dev/quarto-cli#15440 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
crxjs/chrome-extension-tools#1261 ·
-
support
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
01 type: bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
conorbronsdon/avoid-ai-writing#559 ·
I maintainer di solito rispondono entro 1 giorno