Go Pro Sign Up Login

Buy Now and unlock this series

$

49

.99

yours forever

Become a Pro and unlock everything

$

24

.99

per month

Media Queries

Downloads

Become a pro to download code and videos

Comments

User avatar

Raul

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

jared

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!