Skip to content

CSS light / dark mode #4

Open
Open

Description

@Rc-Cookie

I hope you don't mind if I open another issue :)

The @media (prefers-color-scheme: light) CSS patterns don't appear to function properly in the widget. They work in the preview within the app, but if I refresh the widget directly, I always end up with the dark mode version, no matter what I have configured in iOS.

If this was working, then another step would be to auto-refresh each widget on a light-dark-mode change, so that the color can actually match. Or, to be more responsive (as in, swap colors immediately), the widget could also be rendered in light mode and dark mode every time, such that the image can be swapped quickly when needed. To avoid this from increasing the load times of widgets, the second (opposite) color scheme could be rendered after the current one has been, which can then already be presented.

Activity

  1. Villy21 commented on Dec 1, 2025

    @Villy21
    Owner

    @media (prefers-color-scheme: light) didn't work in widgets. Even the Swift code in the widget didn't know the current state. You can now use dark/light mode in the widget settings in the app.
    I'll consider a JS API so that js-widget can access these settings. But it's not easy.

  2. Villy21 commented on Dec 1, 2025

    @Villy21
    Owner

    And due to memory limitations, the widget will not be able to render multiple copies with different settings. iOS limits the widget to 30 MB of RAM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions