Last active
January 14, 2024 12:50
-
-
Save smcstewart/aebfb00173781606dcc20162cd73bd25 to your computer and use it in GitHub Desktop.
Breakpoints overlay w/ Tailwind
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires Tailwind CSS v2.0+ | |
export default function Breakpoints() { | |
return ( | |
<div className="absolute inset-x-0 bottom-0 z-50 bg-red-500 py-4 text-center text-2xl text-black opacity-30 sm:bg-blue-500 md:bg-yellow-500 lg:bg-purple-500 xl:bg-orange-500 2xl:bg-white"> | |
<span className="sm:hidden">No Breakpoint</span> | |
<span className="hidden sm:block md:hidden">sm >= 640px</span> | |
<span className="hidden md:block lg:hidden">md >= 768px</span> | |
<span className="hidden lg:block xl:hidden">lg >= 1024px</span> | |
<span className="hidden xl:block 2xl:hidden">xl >= 1280px</span> | |
<span className="hidden 2xl:block">2xl >= 1536px</span> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment