0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00
astro/.changeset
Abu Bakr 196092ae69
fix: audit incorrectly flagging images as above the fold (#10891) (#11617)
* fix: audit incorrectly flagging images as above the fold (#10891)

Previously used lement.offsetTop to find the y position of the image, which does not work when the element parent has a position: relative property.
Instead, this uses lement.getBoundingClientRect().y top get real y position of the image.
There's one issue though, which is that getBoundingClientRect returns the position relative to the user's viewport, not the absolute position.
So, add window.scrollY to the value to cancel that effect out, and you have the element's absolute position.

https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect
https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY

* chore: add changeset
2024-08-05 13:29:20 +02:00
..
config.json Enter pre mode for Astro 4 beta 2023-11-16 21:53:20 +08:00
dull-taxis-warn.md fix(astro:content): add deprecated to getEntryBySlug & getDataEntryById (#11600) 2024-08-02 16:31:32 +02:00
README.md
shy-bees-look.md fix: audit incorrectly flagging images as above the fold (#10891) (#11617) 2024-08-05 13:29:20 +02:00

Changesets

Hello and welcome! This folder has been automatically generated by @changesets/cli, a build tool that works with multi-package repos, or single-package repos to help you version and publish your code. You can find the full documentation for it in our repository

We have a quick list of common questions to get you started engaging with this project in our documentation