refactor(css): set externalIcon size in CSS#3682
refactor(css): set externalIcon size in CSS#3682jvoisin wants to merge 1 commit intominiflux:mainfrom
Conversation
There is no need to repeat `width="16" height="16"` for every single externalIcon in the HTML, when we can specify this in the CSS instead.
|
I believe it was done this way to prevent layout shift on slow connections. When the width/height attributes are defined directly in HTML, the browser knows the size before the image and stylesheet loads, so it can reserve space in the layout. If you only use CSS, the browser may not reserve the correct space until the CSS is parsed. |
|
https://developer.mozilla.org/en-US/docs/Glossary/CLS (web.dev may have a better doc)
|
|
Even by using the GPRS setting in the devtools of Firefox (50 Kbps download/20 Kbps upload/500ms lattency minimum), I don't notice any layout shift. |
Inspired by miniflux#3682
There is no need to repeat
width="16" height="16"for every single externalIcon in the HTML, when we can specify this in the CSS instead.