A quick implementation of auto/light scheme switch for those who want to stay 
on the light scheme even when their browser says they want the dark one.

![image](https://github.com/user-attachments/assets/66ae2ce8-d30e-4361-af39-31c9d2a20aa8)
![image](https://github.com/user-attachments/assets/0256b9c5-f07e-4014-858e-c5a21d5c05d9)
![image](https://github.com/user-attachments/assets/45f4743a-d339-4183-aea7-3e840a8b67bc)

Its on the `/preferences` page but it's not actually a preference stored in 
the `User` model. It's stored in a cookie. The question is do we want to 
store it in a cookie? Maybe we do because what browser reports as a preferred 
scheme is per browser, not per user, then perhaps its override should also be 
per browser. And it will be easier to extend the availability of this option to 
anonymous users. It is kind of available already, if they know how to edit 
cookies.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/5337

-- Commit Summary --

  * Add auto/light color scheme stylesheets depending on cookies
  * Show color scheme from cookies in preferences
  * Add color scheme select to preferences form
  * Store selected color scheme in cookies

-- File Changes --

    M app/assets/stylesheets/parameters.scss (1)
    A app/assets/stylesheets/screen-auto-ltr.scss (3)
    A app/assets/stylesheets/screen-auto-rtl.rtlcss.scss (3)
    A app/assets/stylesheets/screen-light-ltr.scss (3)
    A app/assets/stylesheets/screen-light-rtl.rtlcss.scss (3)
    D app/assets/stylesheets/screen-ltr.scss (1)
    D app/assets/stylesheets/screen-rtl.rtlcss.scss (1)
    M app/controllers/preferences_controller.rb (3)
    M app/views/layouts/_head.html.erb (6)
    M app/views/preferences/edit.html.erb (7)
    M app/views/preferences/show.html.erb (8)
    M config/locales/en.yml (4)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/5337.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5337.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5337
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to