Skip Navigation

Search

Is there a way to detect if a user is using one of the litely or darkly themes?

I'm currently using const prefersDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches; but it doesn't take into consideration users that use a light system with a dark website.

EDIT: Solved with the following: javascript const element = document.getElementById("app"); const themeVariant = element.getAttribute("data-bs-theme"); if (themeVariant === "light") { var primaryBackground = "#f0f0f0"; } else { var primaryBackground = "#121317"; }

0

I have been steadily getting requests to turn my old.reddit.compact userscript into a Lemmy theme - but I don't know how to do it

github.com GitHub - soundjester/lemmy_monkey: *monkey scripts for Lemmy

*monkey scripts for Lemmy. Contribute to soundjester/lemmy_monkey development by creating an account on GitHub.

GitHub - soundjester/lemmy_monkey: *monkey scripts for Lemmy

Up for discussion:

The userscript I (and others) have written seems to be fairly popular among people who have found it. I've had several requests to turn it into a Lemmy theme, but I have been hesitant to do so. Partly because I lack the skill to do it, and partly because it isn’t really a “theme” as such. It doesn’t change the colors or do some of the things a theme typically does. In truth, the script is actually (essentially) theme agnostic - I use it with darkly, but it works with all of the other Lemmy themes without issue (hopefully).

I have no qualms with someone helping turn the CSS stuff into a Lemmy theme (or just taking the bull by the horns and doing it) , but with the changes coming in v.0.18 it may be better to wait.

Anyone have any thoughts? Is this script even appropriate for a Lemmy theme?

27