django / django/new-features

Namespace the `theme` localStorage key (django.admin.theme) to avoid clashing with main project localStorage

Open
#160 4 comments 8 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
188
Forks
7
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [x] I agree to follow Django's Code of Conduct

### Feature Description

Rename the localStorage key for the /admin page from `theme` to `django.admin.theme`

### Problem

We use the `theme` localStorage for our site, decomp.me. We expect the value to be a json string (e.g. `"auto"`, `"light"` or `"dark"`, etc). When visiting the `/admin` panel, our localStorage value is stomped on and instead `auto` is set (no quotes). We have worked around the fact that this is not JSON (and so we fallback to "auto"), but this still stomps on our users preferences.

### Request or proposal

proposal

### Additional Details

_No response_

### Implementation Suggestions

I have a branch with the change: https://github.com/django/django/compare/main...mkst:django:namespace-admin-theme-key?expand=1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.