Provide solution for different sizes in CSS background-img
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 331
- Avg merge
- 19h 52m
- Merged PRs (30d)
- 9
Description
I have the following Code for providing a CSS background-image:
backgroundStyles() {
const imgUrl = this.$img("forest-1279x852.jpg", {
width: 1279,
format: "webp",
});
return {
backgroundImage: `url(${imgUrl})`,
};
}
Can you please provide a solution for sizing this image down based on the image screens sizes in the config?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the backgroundStyles() entry point and how this.$img handles the width and format options, then inspect how configured image screen sizes are exposed. Done means a background-image can select an appropriately sized image for the configured screen sizes, with the expected behavior verified for responsive backgrounds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript, nuxt
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100