jameslnewell / styled-components-breakpoint

Utility function for using breakpoints with styled-components 💅.
243 stars 17 forks source link

Add the ability to set the em size for breakpoint calculations. #7

Closed bfillmer closed 7 years ago

bfillmer commented 7 years ago

Updated the default breakpoint() and map() implementations to have the ability to take in a custom pixel value for em.

Primarily geared toward leveraging the default breakpoints but with a different base em value depending on the UI needs.

jameslnewell commented 7 years ago

My understanding is that ems in @media are always calculated off 16px so this parameter won't actually work?

https://css-tricks.com/em-based-media-queries-are-based-on/

bfillmer commented 7 years ago

I didn't know that. For the most part I use rem after establishing the base font size and wanted the breakpoints to honor that calculation.

jameslnewell commented 7 years ago

Thanks for taking the time to create a PR! Please re-open if you can get it working despite what the above article mentions.