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

docs: supplement responsive usage #1642

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

a1mersnow
Copy link

@a1mersnow a1mersnow commented Dec 20, 2024

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Try to help beginners use <NuxtImg>'s responsive features.

I changed the example below <NuxtImg>'s sizes property:

<!-- before -->
<NuxtImg
  src="/logos/nuxt.png"
  sizes="100vw sm:50vw md:400px"
/>
<!-- after -->
<NuxtImg
  src="/logos/nuxt.png"
  sizes="300px sm:50vw md:400px"
/>

And I recommend giving a pixel value for the default size.

If you use 100vw as the default size, you will get srcsets of 1w and 2w which do not make sense.

@a1mersnow a1mersnow requested a review from danielroe as a code owner December 20, 2024 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant