Go Pro Sign Up Login

Buy Now and unlock this series




yours forever

Become a Pro and unlock everything




per month

Media Queries


Become a pro to download code and videos


User avatar


almost 2 years ago [edited]

@jared This makes your code easier to be managed if those sizes ever need updating and it is slightly easier to write then a media query. But keep in mind this is just personal preference and doesn't affect performance so you can use a nester media query if you prefer


over 2 years ago

What is the advantage of using this function to pass breakpoints, rather than just writing a nested media query inside the styled-component, and pass the breakpoint in a ${...} from the size object? i.e, @media (min-width: ${size.small}) , etc.

Want to join the conversation?

Become a Pro member today!