Skip to content

Commit b0f4a82

Browse files
author
Timothy Johnson
committed
Dark mode closes #5
1 parent ac894ed commit b0f4a82

22 files changed

+215
-65
lines changed

dest/devtools/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
chrome.devtools.panels.create(
22
'Svelte',
3-
'/devtools/svelte-logo-black.svg',
3+
chrome.devtools.panels.themeName == 'dark' ? '/devtools/svelte-logo-dark.svg' : '/devtools/svelte-logo-light.svg',
44
'/devtools/panel.html',
55
panel =>
66
panel.onShown.addListener(() =>

dest/devtools/panel.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
font-family: monospace;
1818
}
1919

20+
body.dark {
21+
color: rgb(177, 177, 179);
22+
background-color: rgb(42, 42, 46);
23+
}
24+
2025
ul {
2126
margin: 0;
2227
padding: 0;

dest/devtools/svelte-logo-dark.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 1 addition & 1 deletion
Loading

dest/devtools/tool-inspector.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

dest/devtools/visibility.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/App.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
height: 22px;
2828
border: 1px solid rgb(224, 224, 226);
2929
border-radius: 2px;
30-
background: 6px center / 12px no-repeat url('/devtools/search.svg') #ffffff;
30+
background: 6px center / 12px no-repeat url('/devtools/search.svg')
31+
transparent;
32+
color: inherit;
3133
font-size: inherit;
3234
}
3335
@@ -51,6 +53,11 @@
5153
margin-top: 40%;
5254
text-align: center;
5355
}
56+
57+
:global(.dark) input,
58+
:global(.dark) .results :global(> li) {
59+
border-color: rgb(60, 60, 61);
60+
}
5461
</style>
5562

5663
{#if $rootNodes.length}

src/Breadcrumbs.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@
8282
border-left: 2px solid #ffffff;
8383
content: '';
8484
}
85+
86+
:global(.dark) ul {
87+
border-top-color: rgb(60, 60, 61);
88+
}
89+
90+
:global(.dark) div::after {
91+
border-left-color: rgba(135, 135, 137, 0.9);
92+
}
8593
</style>
8694

8795
{#if breadcrumbList.length > 1}

src/CollapsableValue.svelte

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@
7676
right: 0;
7777
font-size: 1rem;
7878
}
79+
80+
:global(.dark) .function,
81+
:global(.dark) .object {
82+
color: rgb(117, 191, 255);
83+
}
84+
85+
:global(.dark) li :global(.string) {
86+
color: rgb(255, 125, 233);
87+
}
7988
</style>
8089

8190
<li

src/ComponentView.svelte

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { selectedNode } from './store.js'
44
import PropertyList from './PropertyList.svelte'
55
import Toolbar from './Toolbar.svelte'
6+
import IconButton from './IconButton.svelte'
67
78
let isResizing = false
89
let width = 300
@@ -29,6 +30,19 @@
2930
.resize:hover {
3031
border-color: rgb(177, 177, 179);
3132
}
33+
34+
:global(.dark) .root {
35+
background-color: rgb(27, 27, 29);
36+
color: rgb(177, 177, 179);
37+
}
38+
39+
:global(.dark) .resize {
40+
border-left-color: rgb(60, 60, 61);
41+
}
42+
43+
:global(.dark) .resize:hover {
44+
border-left-color: rgb(107, 107, 108);
45+
}
3246
</style>
3347

3448
<svelte:window
@@ -38,11 +52,18 @@
3852
<div class="root" style={`width: ${width}px`}>
3953
<div class="resize" on:mousedown={e => (isResizing = true)} />
4054
<Toolbar>
41-
<button
55+
<IconButton
4256
disabled={$selectedNode.id === undefined}
4357
on:click={e => devtools.inspectedWindow.eval('inspect(window.$s)')}>
44-
<img src="/devtools/tool-inspector.svg" alt="Inspect" title="Inspect" />
45-
</button>
58+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
59+
<path
60+
d="M4.5 4a.5.5 0 0 0-.5.5v7c0 .28.22.5.5.5h7a.5.5 0 0 0 .5-.5v-7a.5.5
61+
0 0 0-.5-.5h-7zM2 4.5A2.5 2.5 0 0 1 4.5 2h7A2.5 2.5 0 0 1 14 4.5v7a2.5
62+
2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 11.5v-7M.5 7.5a.5.5 0 0 0 0
63+
1H2v-1H.5zM14 7.5h1.5a.5.5 0 0 1 0 1H14v-1zM8 0c.28 0
64+
.5.22.5.5V2h-1V.5c0-.28.22-.5.5-.5zM8.5 14v1.5a.5.5 0 0 1-1 0V14h1z" />
65+
</svg>
66+
</IconButton>
4667
</Toolbar>
4768
{#if $selectedNode.type == 'component'}
4869
<PropertyList

0 commit comments

Comments
 (0)