diff --git a/app/javascript/flavours/glitch/containers/mastodon.jsx b/app/javascript/flavours/glitch/containers/mastodon.jsx
index 1ab20d022..426c551f7 100644
--- a/app/javascript/flavours/glitch/containers/mastodon.jsx
+++ b/app/javascript/flavours/glitch/containers/mastodon.jsx
@@ -19,6 +19,8 @@ import initialState, { title as siteTitle } from 'flavours/glitch/initial_state'
import { IntlProvider } from 'flavours/glitch/locales';
import { store } from 'flavours/glitch/store';
+import { ThemeComponent } from './theme_component';
+
const title = process.env.NODE_ENV === 'production' ? siteTitle : `${siteTitle} (Dev)`;
const hydrateAction = hydrateStore(initialState);
@@ -79,15 +81,17 @@ export default class Mastodon extends PureComponent {
return (
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
);
diff --git a/app/javascript/flavours/glitch/containers/theme_component.jsx b/app/javascript/flavours/glitch/containers/theme_component.jsx
new file mode 100644
index 000000000..4c9bda60c
--- /dev/null
+++ b/app/javascript/flavours/glitch/containers/theme_component.jsx
@@ -0,0 +1,36 @@
+import PropTypes from 'prop-types';
+import React from 'react';
+
+import { useAppSelector } from 'flavours/glitch/store';
+
+const ThemeComponent = ({ children }) => {
+ const theme = useAppSelector(
+ (state) => state.getIn(['local_settings', 'theme']) ?? 'mastodon-light',
+ );
+
+ let href;
+ switch (true) {
+ case theme === 'mastodon':
+ href = '';
+ break;
+ case theme === 'mastodon-light':
+ href = '/packs/css/skins/glitch/mastodon-light/common.css';
+ break;
+ case theme === 'contrast':
+ href = '/packs/css/skins/glitch/contrast/common.css';
+ break;
+ }
+
+ return (
+ <>
+ {href !== '' ? : null}
+ {children}
+ >
+ );
+};
+
+ThemeComponent.propTypes = {
+ children: PropTypes.node,
+};
+
+export { ThemeComponent };
diff --git a/app/javascript/flavours/glitch/features/local_settings/page/index.jsx b/app/javascript/flavours/glitch/features/local_settings/page/index.jsx
index ca2a4673c..d8e6d6a26 100644
--- a/app/javascript/flavours/glitch/features/local_settings/page/index.jsx
+++ b/app/javascript/flavours/glitch/features/local_settings/page/index.jsx
@@ -52,6 +52,19 @@ class LocalSettingsPage extends PureComponent {
({ intl, onChange, settings }) => (
+
+
+
state.mergeDeep(localSettings);