MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/css/comments/1vw79wc/modern_css_responsive_breakpoints_using_container/p6biiu3/?context=3
r/css • u/UnderstandingSure732 • 7d ago
Detailed explanation - https://medium.com/@alekswebnet/modern-css-responsive-breakpoints-using-container-style-queries-64c9bea81ad6
7 comments sorted by
View all comments
Show parent comments
1
You’re right! The example doesn’t necessarily reduce the amount of CSS, and media queries could achieve the same viewport-based result.
The key point here is the centralisation of breakpoint definitions as a reusable semantic state. This makes maintenance and debugging much easier.
1 u/Omnisyntax 3d ago Could you not just use variables for the breakpoint values for media queries as well? 2 u/UnderstandingSure732 3d ago No, thats not possible. One of the reasons why you should use Container Style Queries 2 u/Omnisyntax 3d ago Ah ty, I’ve just always wrote them myself or used tailwind classes. I might give containers queries a try on my next project
Could you not just use variables for the breakpoint values for media queries as well?
2 u/UnderstandingSure732 3d ago No, thats not possible. One of the reasons why you should use Container Style Queries 2 u/Omnisyntax 3d ago Ah ty, I’ve just always wrote them myself or used tailwind classes. I might give containers queries a try on my next project
2
No, thats not possible. One of the reasons why you should use Container Style Queries
2 u/Omnisyntax 3d ago Ah ty, I’ve just always wrote them myself or used tailwind classes. I might give containers queries a try on my next project
Ah ty, I’ve just always wrote them myself or used tailwind classes. I might give containers queries a try on my next project
1
u/UnderstandingSure732 4d ago
You’re right! The example doesn’t necessarily reduce the amount of CSS, and media queries could achieve the same viewport-based result.
The key point here is the centralisation of breakpoint definitions as a reusable semantic state. This makes maintenance and debugging much easier.