The new syntax allows you to utilize what are essentially like, greater than, are equal to, or like range style operators inside of your media queries. Causo properties has been in sapare i o s since 20 16. Have you dove into custom medea queries at all for c s s? Ii have. It's essentially where you can define the media query early on, and then just uske put it in a variable,. And then yoas that variable. Yecs.
In this Hasty Treat, Scott and Wes talk about next generation CSS that you can use today with PostCSS including importing, nesting, variables, media query ranges, custom media queries, and more.
Prismic - Sponsor
Prismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you like. Make corresponding Slices in Prismic. Start building pages dynamically in minutes. Get started at prismic.io/syntax.
Sentry - Sponsor
If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up.
Show Notes
"postcss-import" @import './elements/headings.css';
"postcss-media-minmax" @media screen and (width >= 500px) and (width <= 1200px) "postcss-custom-media" @custom-media --below_small (width < env(--small_bp)); @media (--above_small) {}
"postcss-env-function" env(--small_bp)
- 20:12 Color Function and Color Function Notation
/* color-function */ p { color: color(display-p3 1 0.5 0); color: color(display-p3 1 0.5 0 / .5); }
Tweet us your tasty treats