@custom-media
Limited availability2% of usersExperimental
An experimental at-rule that lets you define reusable media queries (like '@custom-media --tablet (max-width: 768px)') for cleaner, more maintainable code.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in any major browser yet under this name.
See how modern your own CSS is.Check your CSS →
Quick example
/* Experimental: Define a reusable media query */
@custom-media --small-viewport (max-width: 480px);
@media (--small-viewport) {
.container { padding: 10px; }
}@custom-media browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage2%of people can use this98% use a browser without it.