kevinpowell

Content-First Breakpoints


Listen Later

Picking a breakpoint for media queries can be a little tricky. Generic breakpoints sometimes don’t seem to do the job, and using specific device sizes is problematic because there are too many of them.

That’s why I like to go with more of a content-first approach, to a certain extent anyway. We don’t want to get too precise either, or we end up with way too many of them!

Container queries also change the game a little when it comes to breakpoints, opening up some new options and possibilities.

πŸ”— Links

βœ… The ideal viewport doesn’t exist: https://viewports.fyi/
βœ… Piccalilli article that uses the container query viewport trick: https://piccalil.li/blog/reality-check-1-building-out-a-furniture-site-from-dribbble/
βœ… Code from first example: https://codepen.io/kevinpowell/pen/wBvmdor
βœ… Code from second example: https://codepen.io/kevinpowell/pen/WNVbbXZ/fef60d4f8a980bb59e4eed25fe69cfc0
βœ… Looking to improve your CSS skills? https://kevinpowell.co/courses

⌚ Timestamps

00:00 - Introduction
00:50 - Working with ranges
05:00 - You don’t need all those breakpoints
05:50 - Content-first breakpoint approach
07:00 - Don’t micromanage your breakpoints
07:50 - Approaching this with a real layout
13:50 - When container queries make more sense
19:45 - Container queries based on the size of the columns you want
22:12 - Another example of container queries being useful

#css

βœ‰ Keep up to date with everything I'm up to https://www.kevinpowell.co/newsletter

πŸ’¬ Come hang out with other devs in my Discord Community https://discord.gg/nTYCvrK
⭐ Are you a beginner? HTML & CSS for absolute beginners is for you: https://learn.kevinpowell.co
πŸŽ“ Start writing CSS with confidence with CSS Demystified: https://cssdemystified.com
πŸš€ Already mastered CSS? Check out my advanced course, Beyond CSS: https://www.beyondcss.dev/

Help support my channel

πŸ‘¨β€πŸŽ“ Get a course: https://www.kevinpowell.co/courses
πŸ‘• Buy a shirt: https://cottonbureau.com/people/kevin-powell
πŸ’– Support me on Patreon: https://www.patreon.com/kevinpowell or through YT memberships: https://youtube.com/@KevinPowell/join

πŸ§‘β€πŸ’» My editor: VS Code - https://code.visualstudio.com/

🌈 My theme: One Dark Pro Var Night

πŸ”€ My font: Cascadia Code

I'm on some other places on the internet too!

If you'd like a behind the scenes and previews of what's coming up on my YouTube channel:

Bluesky: https://bsky.app/profile/kevinpowell.co

Codepen: https://codepen.io/kevinpowell/
Github: https://github.com/kevin-powell

And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!

...more
View all episodesView all episodes
Download on the App Store

kevinpowellBy