This repository demonstrates an unexpected behavior when using Tailwind CSS's @apply
directive within media queries. The issue is that the styles are not applied conditionally based on the breakpoint defined in the media query.
When using the @apply
directive to apply multiple Tailwind CSS utility classes within a media query, the classes are not applied conditionally. Instead, they are either applied in all screen sizes or not applied at all.
npm install
to install dependencies.npm start
to start the development server.The solution is to avoid using @apply
inside media queries and manually apply the styles instead or use responsive utility classes like bg-gray-100 md:bg-gray-200
. See the solution file for an implementation of the correct approach.