Wrapstodon {report.year}
{account &&
@{account.acct}
}
diff --git a/app/javascript/flavours/glitch/features/annual_report/modal.tsx b/app/javascript/flavours/glitch/features/annual_report/modal.tsx
index 29034de6b9..654aca8b7d 100644
--- a/app/javascript/flavours/glitch/features/annual_report/modal.tsx
+++ b/app/javascript/flavours/glitch/features/annual_report/modal.tsx
@@ -60,11 +60,8 @@ const AnnualReportModal: React.FC<{
// default modal backdrop, preventing clicks to pass through.
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
{!showAnnouncement ? (
diff --git a/app/javascript/flavours/glitch/features/emoji/emoji.js b/app/javascript/flavours/glitch/features/emoji/emoji.js
index b7ea36d3df..c52604a583 100644
--- a/app/javascript/flavours/glitch/features/emoji/emoji.js
+++ b/app/javascript/flavours/glitch/features/emoji/emoji.js
@@ -1,6 +1,6 @@
import Trie from 'substring-trie';
-import { getUserTheme, isDarkMode } from '@/flavours/glitch/utils/theme';
+import { getIsSystemTheme, isDarkMode } from '@/flavours/glitch/utils/theme';
import { assetHost } from 'flavours/glitch/utils/config';
import { autoPlayGif } from '../../initial_state';
@@ -98,7 +98,7 @@ const emojifyTextNode = (node, customEmojis) => {
const { filename, shortCode } = unicodeMapping[unicode_emoji];
const title = shortCode ? `:${shortCode}:` : '';
- const isSystemTheme = getUserTheme() === 'system';
+ const isSystemTheme = getIsSystemTheme();
const theme = (isSystemTheme || !isDarkMode()) ? 'light' : 'dark';
diff --git a/app/javascript/flavours/glitch/styles/mastodon/theme/index.scss b/app/javascript/flavours/glitch/styles/mastodon/theme/index.scss
index a907299887..a84b8b80da 100644
--- a/app/javascript/flavours/glitch/styles/mastodon/theme/index.scss
+++ b/app/javascript/flavours/glitch/styles/mastodon/theme/index.scss
@@ -5,49 +5,29 @@
html {
@include base.palette;
-
- &:where([data-user-theme='system']) {
- color-scheme: dark light;
-
- @media (prefers-color-scheme: dark) {
- @include dark.tokens;
- @include utils.invert-on-dark;
-
- @media (prefers-contrast: more) {
- @include dark.contrast-overrides;
- }
- }
-
- @media (prefers-color-scheme: light) {
- @include light.tokens;
- @include utils.invert-on-light;
-
- @media (prefers-contrast: more) {
- @include light.contrast-overrides;
- }
- }
- }
}
-.theme-dark,
-html:where(
- :not([data-user-theme='mastodon-light'], [data-user-theme='system'])
-) {
+[data-color-scheme='dark'],
+html:not([data-color-scheme]) {
color-scheme: dark;
@include dark.tokens;
@include utils.invert-on-dark;
+
+ &[data-contrast='high'],
+ [data-contrast='high'] & {
+ @include dark.contrast-overrides;
+ }
}
-html[data-user-theme='contrast'],
-html[data-user-theme='contrast'] .theme-dark {
- @include dark.contrast-overrides;
-}
-
-.theme-light,
-html:where([data-user-theme='mastodon-light']) {
+[data-color-scheme='light'] {
color-scheme: light;
@include light.tokens;
@include utils.invert-on-light;
+
+ &[data-contrast='high'],
+ [data-contrast='high'] & {
+ @include light.contrast-overrides;
+ }
}
diff --git a/app/javascript/flavours/glitch/utils/theme.ts b/app/javascript/flavours/glitch/utils/theme.ts
index 921787a6c4..494ee3cb53 100644
--- a/app/javascript/flavours/glitch/utils/theme.ts
+++ b/app/javascript/flavours/glitch/utils/theme.ts
@@ -1,11 +1,9 @@
-export function getUserTheme() {
- const { userTheme } = document.documentElement.dataset;
- return userTheme;
+export function getIsSystemTheme() {
+ const { systemTheme } = document.documentElement.dataset;
+ return systemTheme === 'true';
}
export function isDarkMode() {
- const { userTheme } = document.documentElement.dataset;
- return userTheme === 'system'
- ? window.matchMedia('(prefers-color-scheme: dark)').matches
- : userTheme !== 'mastodon-light';
+ const { colorScheme } = document.documentElement.dataset;
+ return colorScheme === 'dark';
}