Someone should take my script, generalize it, and publish it to npm to allow for something like: npx add-intrinsicsize src/*.html This would enable adding the intrinsicsize attribute at build time by inspecting the local image files. Great for static websites!
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
what's the concrete difference with just setting width and height already, if you know the size?
-
If you *only* use the `width` and `height` attributes (and no CSS that impacts the dimensions), your images/videos are not responsive. intrinsicsize is useful for responsive web sites.
- 2 more replies
New conversation -
-
-
So where's the spec?
- End of conversation
New conversation -
-
-
So, basically a non-hacky way of setting aspect ratios?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.