Text & icons are not centered vertically on small accordions

Aperta Adatta ai principianti
#43,483 1 commento 1 reazione 0 assegnatari Vedi su GitHub

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
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bootstrap, css, javascript, scss
Ambito
design, frontend

Direzione di ricerca

Inizia leggendo gli stili del piccolo accordion che impostano --accordion-font-size e --accordion-padding-y; l’issue indica come causa l’interlinea omessa. Modifica la variante piccola in modo che il testo dell’intestazione e le icone siano centrati verticalmente, quindi controlla il piccolo accordion nel caso ridotto su uno schermo 1:1. Il lavoro è completato quando il contenuto dell’intestazione espansa è centrato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug confirmed css has-pr v6
Prerequisites
Describe the issue

The text & icons on the menu items 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.

issue-5-1

A zoomed-in view better shows the issue with the text:

issue-5-2

Another zoomed-in view better shows the issue with the icon:

issue-5-3

This issue is caused by the line-height being ommited, and therefore inherited to 1.5. Because --accordion-font-size is set to .875rem for the accordion-sm variant, and the --accordion-padding-y is set to .625rem (which is 10px) the computed accordion header is 41px instead of 40px. Paddings are 20px (10px at the top, 10px at the bottom), and the remaining 21px is the font-size-sm with a line-height of 1.5, 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.

Reduced test cases

Go to: https://getbootstrap.com/docs/6.0/components/accordion/#small on a screen that does not do any scaling (1:1 mapping), and observe the accordion header text not being vertically centered when the accordion is in an uncollapsed state.

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, Microsoft Edge, Firefox, 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di twbs/bootstrap

Tutte le issue di twbs/bootstrap

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.