diff --git a/src/playground/index.ejs b/src/playground/index.ejs index 6dd4ea989..08da52354 100644 --- a/src/playground/index.ejs +++ b/src/playground/index.ejs @@ -42,8 +42,10 @@ document.querySelector('#splash-troubleshooting').textContent = messages[2]; } document.querySelector('#splash-content').style.display = 'block'; + <% if (!htmlWebpackPlugin.options.noTheme) { %> try {var localTheme = localStorage.getItem('tw:theme');} catch (e) {} if (localTheme ? localTheme === 'dark' : window.matchMedia('(prefers-color-scheme: dark)').matches) document.querySelector('#splash').setAttribute('splash-theme', 'dark'); + <% } %> })();
diff --git a/webpack.config.js b/webpack.config.js index 2a3558d59..f0c8973a3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -176,6 +176,7 @@ module.exports = [ template: 'src/playground/index.ejs', filename: 'embed.html', title: 'Embedded Project - TurboWarp', + noTheme: true, ...htmlWebpackPluginCommon }), new HtmlWebpackPlugin({