Skip to content

Making an element a @container messes with the width of the component #29

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

Closed
alexander-densley opened this issue Sep 15, 2024 · 3 comments

Comments

@alexander-densley
Copy link

What version of @tailwindcss/container-queries are you using?

0.1.1

What version of Node.js are you using?

21.4

What browser are you using?

arc with chromium

What operating system are you using?

mac02

Reproduction repository

https://github.com/alexander-densley/permitify

Describe your issue

when I make an element a container, it seems to reduce the element to its min-width. confused as to how to use these if this is the expected behavior. would love any advice.

Screen.Recording.2024-09-14.at.10.34.59.PM.mov
@alexander-densley
Copy link
Author

for context, there are no other uses of container in my code, i just noticed this behavior when I started trying to use it

@ericbf
Copy link

ericbf commented Sep 17, 2024

That’s expected because of how containers work in HTML/CSS. Any CSS container cannot take its width from its children. It must have its width derived regardless of children sizes. See this note about inline-size.

This is not related to this plugin, it’s just how CSS Containers work.

@alexander-densley
Copy link
Author

@ericbf thanks!

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