Bug 189766

Summary: Web Inspector: Dark Mode: use the same CSS variables for dark and light modes
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 189673    
Bug Blocks:    
Attachments:
Description Flags
Patch none

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.