Currently, my index.html page features a dark theme:
<base href="/">
<html>
<head>
<title>XXX</title>
</head>
<body>
<link rel="stylesheet" type="text/css" href="assets/dark_room.css">
<my-app>Loading...</my-app>
</body>
</html>
In addition to the dark theme, I have a bright "light_room.css" theme that users can switch to according to their preferences. How can I implement this feature?
My initial thought was to use a URL parameter, so if a user types ?light_room=True
at the end of the URL, the light_room.css file would load. However, I realize this may not be possible in index.html as it is typically used for static content.
Has anyone encountered a similar situation and successfully conditionally loaded a CSS file in their index.html?