-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support for multiple containers / components on page #3
Comments
Your suggestion seems logical. I've been butting up against this as well. Also want to thank everyone who is contributing to this project - this polyfill will help boost adoption of one of the most interesting new specs! |
Thanks for the great reproduction. I was able to replicate it, while seeing that the issue was not present in my current testing demos. I’m going to spend more time looking into why this is and hopefully pushing a solution soon. |
Shouldn't it depend on what element the javascript adds the |
Maybe the postcss function can produce css module style css variables? So that multiple containers can all track their container sizes? |
Do you got any workaround guys? it can really help me out |
It looks to me like @media --css-container and (min-width: 800px) {
._titleLink_1ub1h_13 {
grid-template-columns:1fr 2fr 1fr;
grid-template-areas:"unofficial distractible scoreboard"
}
} is querying So something like |
Absolutely, But i don't think this polyfill is being maintained anymore though. const hasContainerQueryPolyfill = mediaText.indexOf('@container') === 0 || mediaText.indexOf('--css-container') === 0 returns false for the rest of the containers. |
It looks like the polyfill needs to be updated for container names to support multiple containers now that the spec supports it! |
Indeed, thats definitely a deal breaker |
Pull request fix: |
When I add multiple containers/contained elements on the page the polyfill behaves strange.
Would be nice to have a example for multiple containers / unit tests.
Example 1 (normal website): we have one (global) container and two contained
Variant 1: https://stackblitz.com/edit/cqfill-multiple-containers?file=index.html
Variant 2: https://stackblitz.com/edit/cqfill-one-container-multiple-contained-media?file=style.css
it works as expected then.
Example 2 (Component based development): - we have two containers and two contained (basically if you develop isolated component based > webcomponents, angular,.... it's always this case):
https://stackblitz.com/edit/cqfill-multiple-containers-multiple-components?file=index.html
only the first will work because of the --css-container variable?
I think the postcss plugin should process it > make a central container or use multiple --css-container variables
The text was updated successfully, but these errors were encountered: