Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save merelinguist/ca4e68d15e405b036cc783b29d7b7d6d to your computer and use it in GitHub Desktop.
Save merelinguist/ca4e68d15e405b036cc783b29d7b7d6d to your computer and use it in GitHub Desktop.
import { Head } from 'blitz';
import * as React from 'react';
const Viewer = () => {
React.useEffect(() => {
for (const styleSheet of document.styleSheets) {
if (styleSheet.href && !styleSheet.href.includes('tailwind')) {
styleSheet.disabled = true;
}
}
for (const styleNode of document.querySelectorAll('style')) {
styleNode.remove();
}
}, []);
return (
<>
<Head>
<style>
{`
body: {
display: relative !important;
}
`}
</style>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@tailwindcss/ui@latest/dist/tailwind-ui.min.css"
/>
</Head>
<div className="absolute w-screen h-screen bg-white">
<div className="antialiased text-gray-900">
<h1 className="text-2xl font-extrabold">Hello, world</h1>
<button className="btn btn-primary">Button</button>
</div>
</div>
</>
);
};
// eslint-disable-next-line
export default Viewer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment