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

Update contain to container #10

Open
djmtype opened this issue Sep 27, 2021 · 4 comments
Open

Update contain to container #10

djmtype opened this issue Sep 27, 2021 · 4 comments

Comments

@djmtype
Copy link

djmtype commented Sep 27, 2021

There was very recently a spec change from contain to container.

https://drafts.csswg.org/css-contain-3/#container-queries.

Change this:

.element {
  contain: layout inline-size;
}

To this:

.element {
  container: inline-size;
}
@jasikpark
Copy link
Contributor

This is a diff spec over CSS Containment Level 2. It is currently an Exploratory Working Draft: if you are implementing anything, please use Level 2 as a reference. We will merge the Level 2 text into this draft once it reaches CR.

from CSS Containment Level 3

I believe this means that the polyfill should be implementing CSS Containment Level 2 still no?

@jasikpark
Copy link
Contributor

jasikpark commented Nov 3, 2021

On second thought since I've heard this is meant to reflect the current implementation & Chrome Canary uses container, you have a point!

@djmtype
Copy link
Author

djmtype commented Nov 3, 2021

@jasikpark When I initially posted this issue, I learned of it via CSS Tricks. You can hear Chris Coyier respond, "Oh, it's container now?" https://youtu.be/8Je-zvnQSMg?t=230.

I think contain still works but with some caveat you need to be more verbose like contain: style inline-size layout. However, this spec hasn't been finalized, so it might change yet again.

@HolgerJeromin
Copy link

JFYI https://github.com/GoogleChromeLabs/container-query-polyfill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants