Created
April 28, 2026 16:08
-
-
Save sorvell/7c11cd20c1e619630a91cf2bfa6ca43a to your computer and use it in GitHub Desktop.
Declarative Shadow DOM without FOUC
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="https://esm.sh/@awesome.me/webawesome/dist/styles/themes/default.css"> | |
| <link rel="preload" href="https://esm.sh/@awesome.me/webawesome/dist/styles/native.css" as="style"> | |
| <script> /* link preload + script to prevent FOUC on Firefox/Safari */ </script> | |
| </head> | |
| <body> | |
| <h2>DSD Fouc Test</h2> | |
| <div>must not layout shift</div> | |
| <div> | |
| <template shadowrootmode="open"> | |
| <style> | |
| /* @import to prevent FOUC on Chrome */ | |
| @import url("https://esm.sh/@awesome.me/webawesome/dist/styles/native.css"); | |
| </style> | |
| <button class="wa-button>">must not fouc!</button> | |
| </template> | |
| </div> | |
| <div>must not layout shift</div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment