Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Replace <img> with Next Image #151

Open
4 tasks
xHayden opened this issue Sep 10, 2024 · 0 comments
Open
4 tasks

[Feature] Replace <img> with Next Image #151

xHayden opened this issue Sep 10, 2024 · 0 comments

Comments

@xHayden
Copy link
Contributor

xHayden commented Sep 10, 2024

Context

Some images are loaded with the <img> tag instead of <Image> from Next.js. We should use that instead, since it optimizes loading.
Images should also be stored as webp for compression reasons/loading.

Requirements

Frontend

  • Use <Image> instead of <img> where possible

Backend

  • Create webp versions of each stored png/jpeg/etc

Acceptance Criteria

  • Replace uses of HTML img with Next Image
  • Use webp versions of stored image files instead of other filetypes
  • Ensure that images remain reactive
  • Ensure images do not have layout shifts (See notes)

Notes

Next Image
Responsive Images/Static Images without Layout Shifts

Because next/image is designed to guarantee good performance results, it cannot be used in a way that will contribute to layout shift, and must be sized in one of three ways:

  1. Automatically, using a static import
  2. Manually, by including a width and height property used to determine the image's aspect ratio.
  3. Implicitly, by using fill which causes the image to expand to fill its parent element.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant