Text & buttons are not vertically centered on toast component
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- css, javascript, scss
- Ambito
- frontend
Direzione di ricerca
Inizia leggendo gli stili del componente toast di Bootstrap e le variabili toast per la dimensione del carattere e il padding verticale; l’issue non indica file o test specifici. Verifica in che modo l’interlinea ereditata influisce sull’altezza dell’intestazione e sull’allineamento verticale con una scala di 1:1. Il lavoro è completato quando il testo del toast e i pulsanti sono centrati verticalmente e il pixel aggiuntivo segnalato è scomparso.
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
The text & buttons on the toast component are not vertically centered. This is very noticeable on 1:1 scaling. This issue might not be so visible on high-DPI screens (2:1 or 3:1), due to how scaling works.
A zoomed-in view better shows the issue with the text:
A zoomed-in view better shows the issue with the buttons:
This issue is caused by the line-height being ommited, and therefore inherited to 1.5. Because --toast-font-size is set to .875rem, the computed line height is 21px, and since the toast-padding-y is set to .75rem (which is 12px), the total computed height of the toast header is 45px instead of 44px, therefore an additional pixel is present at the bottom row (because the line height was computed to 21px and the font-size is 14px, there's 3px at the top and 4px at the bottom of the line. This also causes the button, which is a square (20px by 20px) not being centered, as there's no way to position 20px vertically on 21px of available space.
Reduced test cases
Go to: https://getbootstrap.com/docs/6.0/components/toasts/#basic on a screen that does not do any scaling (1:1 mapping), and observe the toast text text not being vertically centered.
What operating system(s) are you seeing the problem on?
Linux, iOS, Android, macOS, Windows
What browser(s) are you seeing the problem on?
Opera, Firefox, Microsoft Edge, Safari, Chrome
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 75/100
twbs/bootstrap#43483 · 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 68/100
twbs/bootstrap#43482 · 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