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

Make a responsive-height-craft-visual component #1

Open
weotch opened this issue May 6, 2021 · 3 comments
Open

Make a responsive-height-craft-visual component #1

weotch opened this issue May 6, 2021 · 3 comments

Comments

@weotch
Copy link
Member

weotch commented May 6, 2021

The point would be for 100vw x 100vh images where srcset alone isn't going to cut it. Take the case of a square viewport and a 16:9 image. It's going to get scaled up to fit the viewport. The solve would be something like this, where we create a bunch of source elements. It would pretty much requires an image CDN to work.

This would probably consume responsive-craft-visual. I don't have a clear line of site on the API for this.

@weotch
Copy link
Member Author

weotch commented Jan 6, 2022

@jonjahr came up with another solution for this kind of issue here: https://bkwld.slack.com/archives/C07D9R4FK/p1641496583019300

Maybe this could be a simple functional component that produces those vmax style sizes rules...

@jonjahr
Copy link

jonjahr commented Jan 7, 2022

Yea, I like this. But why a functional component? Like, why not just a prop we add to contentful-visual/craft-visual... then they use a shared function to compute sizes, then generate their own srcsets.

@weotch
Copy link
Member Author

weotch commented Jan 24, 2022

I'm open to that too. It'd depend on many lines of code were required to implement this. I like the idea of the core visual components only being concerned with rendering a assets and higher order components adding additional features.

@weotch weotch transferred this issue from BKWLD/cloak Apr 26, 2022
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

No branches or pull requests

2 participants