skip to content
Site header image Nerdy Momo Cat

Scale Font Based on Screen Size With Tailwind


Today I learnt that Tailwind doesn’t automatically scale base font sizes based off screen or viewport sizes. Sure there are plugin options and complicated stuff, but I am not a front end wizard, and adding this to my global.css helped. You check out the difference in font size for this website on mobile and desktop.

html {
    font-size: 14px;
    @media screen(sm) {
      font-size: 16px;
    }
  }