-
Notifications
You must be signed in to change notification settings - Fork 128
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
Responsive Sizing #76
Comments
Currently the only way is to set it dynamically like what you did. I will improve this very soon. So what we need is let croppa automatically adjust its size to fit a container whose size can be controlled with CSS. Is that right? So that you can make it responsive just like how you make a normal block element responsive. |
That would be ideal. |
@wunderdojo Checkout new version 1.3.0. With the new prop |
Thank you for the update, however it doesn't work as expected when the parents box-sizing is set to border-box and has a border. (Especially if it has a thick border) |
Thanks a ton for your library, it was exactly what I needed for a project and works beautifully. One thing I ran into -- and I might just be missing an option or something -- is that the width and height only take pixel values, not percentages. I'm opening croppa in a modal window and depending on the screen size I need it to adjust accordingly. In other words, if someone is using it on a phone it needs to be much smaller than if they're on a large monitor.
What I've done for now is used a method that sets the width and height dynamically when the modal is opened. In this example I want a 1:1 aspect ratio so I use the same value for width and height:
I could use a series of if / else statements to adjust for various breakpoints but this works for my current use case. Is there a better way of making it responsive?
The text was updated successfully, but these errors were encountered: