Skip to content

Commit

Permalink
yoloing at 2024-09-19T02.22
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3h3ad committed Sep 18, 2024
1 parent c38ec8d commit fd9c0ca
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions nextjs/tailwind-indicator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Tailwind helper to show current media query size

React component that shows the current media query size in the bottom corner when in local environment. Import in `layout.tsx`.

```js
export function TailwindIndicator() {
if (process.env.NODE_ENV === "production") return null;

return (
<div className="fixed bottom-1 left-1 z-50 flex size-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white">
<div className="block sm:hidden">xs</div>
<div className="hidden sm:block md:hidden">sm</div>
<div className="hidden md:block lg:hidden">md</div>
<div className="hidden lg:block xl:hidden">lg</div>
<div className="hidden xl:block 2xl:hidden">xl</div>
<div className="hidden 2xl:block">2xl</div>
</div>
);
}
```

[source](https://x.com/saltcod/status/1835827729687511286)

0 comments on commit fd9c0ca

Please sign in to comment.