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

grid-container: allow the grid to shrink to fit all avalible space to prevent sidescroll. #269

Merged
merged 4 commits into from
Mar 21, 2025

Conversation

tryoxiss
Copy link
Contributor

@tryoxiss tryoxiss commented Mar 12, 2025

On some browsers, this has no effect on very small sizes such as 250px, since there is another limiting factor which prevents further shrinkage (e.g., word length). However this does work if the size is increased or the other limiting factors are removed.

Description

This simply replaces 250px with min(250px, 100%). This makes it so that if not enough space is avalible, the grid will simply take up all avalible space instead of forcing horizontal scroll.

Type of Change

  • ✨ New snippet
  • :tools: Improvement to an existing snippet
  • 🐞 Bug fix
  • 📖 Documentation update
  • 🔧 Other (please describe):

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • [N/A] Documentation has been updated (if applicable).
  • [N/A] There are no new warnings or errors from my changes.

Related Issues

Closes #267

Additional Context

Screenshots (Optional)

(column width increased in demos for ease of demonstration)

Before:
image

After:
image

Click to view screenshots

EDIT: Update images so the viewport is exactly the same width

Add myself to comply with quicksnip contribution guidelines
For some reason "edit and fork" didn't save my inital edit which did this on my fork, thanks github.
@technoph1le technoph1le merged commit 922c915 into technoph1le:main Mar 21, 2025
2 checks passed
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] - grid layout / .grid-container will overflow if in a space less than 250 px
3 participants