Replies: 6 comments 9 replies
-
I would lean towards having the <media-responsive>
<media-controller>
<media-breakpoint small>
<media-control-bar>
</media-control-bar>
</media-breakpoint>
<media-breakpoint medium>
<media-control-bar>
</media-control-bar>
</media-breakpoint>
</media-controller>
</media-responsive> |
Beta Was this translation helpful? Give feedback.
-
Also, in terms of container queries, depending on timing, we might be able to out wait the clock, since STP has them now, and chrome is implementing it soon. I think we'd just want to re-evaluate when we're ready to work on this and see where CQs are in browsers at the time. |
Beta Was this translation helpful? Give feedback.
-
Hi, I want to share the fact that aspect-ratio css property is now fully supported: https://caniuse.com/?search=aspect-ratio That's it. Best regards. |
Beta Was this translation helpful? Give feedback.
-
After seeing other projects and experimenting a little I think we might be trying to over-engineer here. This snippet is pretty much what is needed, Adding classes that the theme author can target in CSS or if using a render engine exclude parts of the DOM tree. |
Beta Was this translation helpful? Give feedback.
-
What feels better -- let's say I have a very simple example: A control bar that has:
Something like (I'm using self-closing html elements for brevity): Option 1<style>
media-controller[sm] media-full-screen-button {
display: none;
}
media-controller[md] media-full-screen-button {
display: block;
}
</style>
<media-controller>
<media-control-bar>
<media-play-button />
<media-full-screen-button />
</media-control-bar>
</media-controller> Option 2<media-controller>
<media-breakpoint sm>
<media-control-bar>
<media-play-button />
</media-control-bar>
</media-breakpoint>
<media-breakpoint md>
<media-control-bar>
<media-play-button />
<media-full-screen-button />
</media-control-bar>
</media-breakpoint>
</media-controller> |
Beta Was this translation helpful? Give feedback.
-
Given the current support for container queries that is pretty big already with Chrome 105+ and Safari 16 and that Firefox is the only missing one which has a pretty small marketshare at this point. Maybe our solution is to go full-in on container queries with the container queries polyfill used for firefox support (not included by default, but strongly encouraged/documented and also tested with)? This is because either of the above solutions, once implemented, will be available forever, so, if we're thinking that they may change down the line, it might be better to side-step it and go all in on container queries now. |
Beta Was this translation helpful? Give feedback.
-
Wanted to open up a discussion and reference post on having different views / layouts for different container sizes or other conditions. Related to Media Themes, #42
Suggestion by @dylanjha:
Another option could be to have a special custom element for it:
Should this be part of Media Chrome or could it be more generic?
What can we learn from CSS frameworks, Tailwind CSS?
Any custom elements already out there for this purpose?
Is it overkill to use JS for this?Have to, because container queries are not supported yet. Must use ResizeObserver.Do we want to hide via CSS or actually add/remove nodes from the DOM?
Interesting related projects:
Beta Was this translation helpful? Give feedback.
All reactions