Can we’ve {custom} media queries, please?

No Comments

Stefan Judis notes that there’s a spec for {custom} media queries, however seemingly no momentum on it in the intervening time. That lack of motion is unlucky, because it’s virtually assured front-end builders throughout would begin utilizing it as quickly because it’s prepared. I do know I’d, as I liberally use {custom} properties now, and the DRYness of {custom} properties is without doubt one of the very same advantages we’d get with {custom} media queries.

The syntax is:

@custom-media –narrow-window (max-width: 30em);

@media (–narrow-window) {
/* slender window types */
}
@media (–narrow-window) and (script) {
/* particular types for when script is allowed */
}

..which I lifted from the Chrome Bug (star it to sign curiosity).

I’ve come round on the thought of postcss-preset-env. It used to suppose it was too theoretical which made me nervous. — a lot CSS isn’t significantly polyfill-able with out JavaScript. Plus, if something modified with the specs, you’ve mainly locked your self right into a CSS processor reasonably than getting future options, as that processing ultimately stops processing. However all of the CSS transformations in right here usually appear fairly chill, ship quite a lot of worth (like {custom} media queries!), and you may decide which stage you’re feeling most comfy with.

Direct Hyperlink to ArticlePermalink

The publish Can we’ve {custom} media queries, please? appeared first on CSS-Methods. You’ll be able to help CSS-Methods by being an MVP Supporter.

    About Marketing Solution Australia

    We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

    Request a free quote

    We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

    Subscribe to our newsletter!

    More from our blog

    See all posts

    Leave a Comment