-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
✨ Container Queries #334
Comments
How to know |
As responsive breakpoints currently only support width, specifying height may require writing a full CSS query. <div class="container:inline-size">
<div class="font:32@container(min-height:600px)">
<h2>Card title</h2>
<p>Card content</p>
</div>
</div> |
@1aron Just throwing a different shorter syntax for defining the container which I'm currently using: rules: {
'@container': {
match: /^@container/,
declare(value) {
let [name = '', type = 'inline-size'] = value.split('/');
name && (name = `${name} / `);
return {
container: name + type
};
}
}
}
<div class="@container" /> // container: inline-size
<div class="@container:sidebar" /> // container: sidebar / inline-size
<div class="@container:sidebar/size" /> // container: sidebar / size and here is a different way for using the queries on the child elements that you might consider, like the following
|
@moaali Looks good! |
I think use |
This feels like media queries or css breakpoints |
Description
Too many people have asked about this feature, and here is the proposal of Master CSS 2.X Container Queries.
Applying styles based on a container's size
Generated CSS
Creating named container contexts
We intend to fallback any unknown at tokens to container names.
Generated CSS
The text was updated successfully, but these errors were encountered: