Responsywność
responsive/dynamic-viewport-units
A full-height layout uses 100dvh (or svh) instead of 100vh, which is taller than the visible area on mobile.
drobnastatycznefe-responsive
Dlaczego
On mobile browsers 100vh equals the viewport with the address bar hidden, so a full-height hero or a sticky footer is cut off or jumps when the bar shows.
Poprawka
Use min-height: 100dvh (follows the visible area) or 100svh (the smallest, stable value). Keep a 100vh line before it only if you support browsers without the new units. With Tailwind, use min-h-dvh or min-h-svh instead of min-h-screen.
Przykłady
/* bad */
.hero { min-height: 100vh; }
/* good */
.hero { min-height: 100svh; }Źródła
Fakty
- Identyfikator
responsive/dynamic-viewport-units- Waga
- drobna
- Sprawdzanie
- statyczne sprawdzane w kodzie źródłowym przez
audit - Dotyczy plików
cssscsslesshtmlvuesvelteastrojsxangular- Uczy jej skill
fe-responsiveResponsive design- Od wersji
- 0.1.0
Przeczytaj w terminalu
npx github:dawidolko/frontend-skills explain responsive/dynamic-viewport-units