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

Add new responsive algorithm #152

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

razzeee
Copy link

@razzeee razzeee commented Jun 9, 2024

Actually take up 100% of the window width - ignore, height, as we're calculating the width here.

image

Might fix #149

Actually take up 100% of the window width - ignore, height, as we're calculating the width here.
Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be a bad idea to hardcode the width in general, because as the issue said, this made the container unstylable. I'm also not a fan of two options that only differ in a magic constant. Maybe we can defer the width calculation to CSS, and then here use something like getClientBoundingBox to retrieve the dimensions instead?

@razzeee
Copy link
Author

razzeee commented Jul 29, 2024

I'm also not a fan of another variant, but it's the only way to do this without breaking api.

I couldn't get a bounding rect approach to work like I wanted.

@razzeee
Copy link
Author

razzeee commented Sep 26, 2024

Can we improve this somehow?

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Sep 28, 2024

IMO, responsive is just a nice default, and if you want something more customizable you can already just pass a number in pixels to size and you can implement your own logic for calculating the right size. The only new size option I'm personally wanting to see is making the size relative to the parent container rather than the window.

@razzeee
Copy link
Author

razzeee commented Oct 3, 2024

That would be helpful I guess. The idea with size as number is good, but it would be much easier, for my usecase, if I could set the height and the width would be automatically calculated.

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.

[BUG] Responsive size calculation is buggy
2 participants