Skip to content

Commit 50625f9

Browse files
author
Rich Harris
committed
tidy up
1 parent e3714d4 commit 50625f9

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

content/tutorial/03-advanced-svelte/09-special-elements/04-svelte-window/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: <svelte:window>
44

55
Just as you can add event listeners to any DOM element, you can add event listeners to the `window` object with `<svelte:window>`.
66

7-
On line 11, add the `keydown` listener:
7+
We've already got a `handleKeydown` function declared — now all we need to do is add a `keydown` listener:
88

99
```svelte
1010
/// file: App.svelte
11-
<svelte:window on:keydown={handleKeydown}/>
11+
<svelte:window +++on:keydown={handleKeydown}+++ />
1212
```
1313

1414
> As with DOM elements, you can add [event modifiers](/tutorial/event-modifiers) like `preventDefault`.

content/tutorial/03-advanced-svelte/09-special-elements/04-svelte-window/app-a/src/lib/App.svelte

+5-6
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@
2929
}
3030
3131
kbd {
32-
background-color: #eee;
3332
border-radius: 4px;
3433
font-size: 6em;
3534
padding: 0.2em 0.5em;
36-
border-top: 5px solid rgba(255, 255, 255, 0.5);
37-
border-left: 5px solid
38-
rgba(255, 255, 255, 0.5);
39-
border-right: 5px solid rgba(0, 0, 0, 0.2);
40-
border-bottom: 5px solid rgba(0, 0, 0, 0.2);
35+
background-color: #eeeeee;
36+
border-top: 5px solid #f9f9f9;
37+
border-left: 5px solid #f9f9f9;
38+
border-right: 5px solid #aaaaaa;
39+
border-bottom: 5px solid #aaaaaa;
4140
color: #555;
4241
}
4342
</style>

content/tutorial/03-advanced-svelte/09-special-elements/04-svelte-window/app-b/src/lib/App.svelte

+5-6
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@
2929
}
3030
3131
kbd {
32-
background-color: #eee;
3332
border-radius: 4px;
3433
font-size: 6em;
3534
padding: 0.2em 0.5em;
36-
border-top: 5px solid rgba(255, 255, 255, 0.5);
37-
border-left: 5px solid
38-
rgba(255, 255, 255, 0.5);
39-
border-right: 5px solid rgba(0, 0, 0, 0.2);
40-
border-bottom: 5px solid rgba(0, 0, 0, 0.2);
35+
background-color: #eeeeee;
36+
border-top: 5px solid #f9f9f9;
37+
border-left: 5px solid #f9f9f9;
38+
border-right: 5px solid #aaaaaa;
39+
border-bottom: 5px solid #aaaaaa;
4140
color: #555;
4241
}
4342
</style>

0 commit comments

Comments
 (0)