Currently, I am working on a project using Tailwind CSS and Next.js. I want to customize the font size of h1
element from 40px to 46px for desktop screens (1440px) and then adjust it to 30px for mobile web (375px).
I attempted to add a new property in the tailwindcss.config
file:
fontSize: {
h1: '46px',
h2: '40px',
},
However, I am struggling to implement this customization for mobile devices.
In the past, I would handle this in a regular CSS file like so:
h1{
font-size:46px
}
@media only screen and (max-width: 375px) {
h1{
font-size: 30px;
}
}