23
submitted 1 week ago by nutomic@lemmy.ml to c/fediverse@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] nutomic@lemmy.ml 1 points 5 days ago

It uses the browser preference for light/dark theme by default. After you click the theme toggle on the site, it keeps using that chosen theme by storing it in a cookie.

[-] d_k_bo@feddit.org 1 points 5 days ago

It uses the browser preference for light/dark theme by default

This doesn't work for me. It seems like you are using leptos_use::use_preferred_dark with server-side rendering which unfortunately uses the experimental Sec-CH-Prefers-Color-Scheme header which isn't supported by all browsers, e.g. Firefox.

In my opinion, it is way better to implement theme switching on the client side. The prefers-color-scheme media query is better supported across browsers and allows reacting to a change of the user's system preferences.

[-] nutomic@lemmy.ml 2 points 5 days ago

Sounds like you are familiar with this topic. I dont have time to work more on this particular aspect (there are lots of other tasks like comment support, federation with Lemmy, etc). But contributions are definitely welcome, preferably directly to leptos_use so that others can benefit and its easier to maintain.

[-] d_k_bo@feddit.org 2 points 5 days ago

I'll look into it if I find the time.

this post was submitted on 17 Dec 2024
23 points (100.0% liked)

Fediverse

17852 readers
17 users here now

A community dedicated to fediverse news and discussion.

Fediverse is a portmanteau of "federation" and "universe".

Getting started on Fediverse;

founded 5 years ago
MODERATORS