Bug 189766 - Web Inspector: Dark Mode: use the same CSS variables for dark and light modes
Summary: Web Inspector: Dark Mode: use the same CSS variables for dark and light modes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
: 190181 (view as bug list)
Depends on: 189673
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-19 15:29 PDT by Nikita Vasilyev
Modified: 2018-10-01 18:31 PDT (History)
4 users (show)

See Also:


Attachments
Patch (29.02 KB, patch)
2018-09-22 19:35 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2018-09-19 15:29:52 PDT
With the dark mode, I added several dozen CSS variables. Currently, they are *only* used by the dark mode. The goal was to not break anything in the light mode while working on the dark mode.

This is what it often looks like in the code:

.cm-s-default {
    color: black;
}

@media (prefers-dark-interface) {
    :root {
        --text-color: hsl(0, 0%, 88%);
    }
    .cm-s-default {
        color: var(--text-color);
    }
}

Now that we don't expect many changes in the dark mode, it makes sense to start using the same variables for the light mode as well:

:root {
    --text-color: black;
}

@media (prefers-dark-interface) {
    :root {
        --text-color: hsl(0, 0%, 88%);
    }
}

.cm-s-default {
    color: var(--text-color);
}
Comment 1 Radar WebKit Bug Importer 2018-09-19 15:30:16 PDT
<rdar://problem/44619650>
Comment 2 Nikita Vasilyev 2018-09-22 19:35:58 PDT
Created attachment 350543 [details]
Patch

This patch focuses on --text-color and --background-color.
There's more to be done, but I plan to complete the refactoring in 3-4 patches.
Comment 3 Nikita Vasilyev 2018-10-01 18:04:58 PDT
*** Bug 190181 has been marked as a duplicate of this bug. ***
Comment 4 Matt Baker 2018-10-01 18:06:19 PDT
Comment on attachment 350543 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2018-10-01 18:31:44 PDT
Comment on attachment 350543 [details]
Patch

Clearing flags on attachment: 350543

Committed r236705: <https://trac.webkit.org/changeset/236705>
Comment 6 WebKit Commit Bot 2018-10-01 18:31:45 PDT
All reviewed patches have been landed.  Closing bug.