From e75b62e8956ddfde07f714ca41853504a1db0e66 Mon Sep 17 00:00:00 2001 From: Midhun Suresh <midhunr@element.io> Date: Wed, 5 Jan 2022 18:07:28 +0530 Subject: [PATCH] Add class programatically --- index.html | 4 ++-- src/main.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index cb46096..145467a 100644 --- a/index.html +++ b/index.html @@ -5,10 +5,10 @@ <link rel="icon" type="image/svg+xml" href="favicon.svg" /> <link rel="stylesheet" href="src/style.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <title>Vite App</title> + <title>Chatterbox</title> </head> <body> - <div id="chatterbox" class="hydrogen" data-config-link="./config.json"></div> + <div id="chatterbox" data-config-link="./config.json"></div> <script type="module" src="/src/main.ts"></script> </body> </html> diff --git a/src/main.ts b/src/main.ts index a34e6b8..fc4717d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,6 +20,7 @@ async function main() { if (!root) { throw new Error("No element with id as 'chatterbox' found!"); } + root.className = "hydrogen"; const config = await fetchConfig(root); const platform = new Platform(root, assetPaths, {}, { development: import.meta.env.DEV }); const navigation = createNavigation(); -- GitLab