Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

conditional statement for media query on tailwindcss

How can i put this

${window.scrollY > 0 ? " bg-slate-50" : ""} 

Conditional statement only for medium or large screens on tailwind?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

${window.scrollY > 0 ? "max-md:bg-slate-50" : ""}

you can also get the reference from the documentation of Tailwind for more info:
https://tailwindcss.com/docs/responsive-design#targeting-a-single-breakpoint

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading