Created
June 19, 2020 13:19
-
-
Save merelinguist/ca4e68d15e405b036cc783b29d7b7d6d to your computer and use it in GitHub Desktop.
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
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