Commit 37125e2
authored
refactor: simplify background handling (#38913)
## **Description**
Simplify handling of dark/light theme background using the light-dark
function
Also fixes #38827 where the document needs to match the main container
background
[](https://codespaces.new/MetaMask/metamask-extension/pull/38913?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: null
## **Related issues**
Fixes: #38827
## **Manual testing steps**
1. Go to this page...
2.
3.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Simplifies global dark/light theming by using CSS light-dark and
consolidating document/background color handling in
`ui/css/base-styles.scss`.
>
> - **Global CSS/Theming** (`ui/css/base-styles.scss`):
> - Use `color-scheme: dark light` and `light-dark(...)` in `:root` to
set default text and background colors.
> - Replace complex `prefers-color-scheme` and non-`data-theme`
conditionals with a single `html[data-theme]` rule for theme overrides.
> - Remove background styling coupling from `#app-content` so the
document and main container backgrounds align.
> - Keep base element resets; no structural layout changes beyond
background/color handling.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
de2fc83. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent c306c13 commit 37125e2
1 file changed
+7
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | | - | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
50 | 34 | | |
51 | 35 | | |
52 | 36 | | |
| |||
55 | 39 | | |
56 | 40 | | |
57 | 41 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 42 | | |
63 | 43 | | |
64 | 44 | | |
| |||
0 commit comments