Skip to content

Instantly share code, notes, and snippets.

@pil0u
Last active August 24, 2021 09:25
Show Gist options
  • Save pil0u/1500c6579980ebe38f8d22f9e36e8b7b to your computer and use it in GitHub Desktop.
Save pil0u/1500c6579980ebe38f8d22f9e36e8b7b to your computer and use it in GitHub Desktop.
Display the current media query breakpoint for Tailwind 2.2.x
<div class="fixed bottom-0 right-0 p-2 bg-white text-black">
<span class="mr-1">Current breakpoint:</span>
<span class="font-bold sm:hidden">default (&lt; 640px)</span>
<span class="font-bold hidden sm:inline md:hidden">sm</span>
<span class="font-bold hidden md:inline lg:hidden">md</span>
<span class="font-bold hidden lg:inline xl:hidden">lg</span>
<span class="font-bold hidden xl:inline 2xl:hidden">xl</span>
<span class="font-bold hidden 2xl:inline">2xl</span>
</div>
@pil0u
Copy link
Author

pil0u commented Aug 24, 2021

Totally inspired by @jonsugar's gist, just simplified the style and added the 2xl default breakpoint.

To be customised at your will in terms of style, position and custom breakpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment