Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit50625f9

Browse files
author
Rich Harris
committed
tidy up
1 parente3714d4 commit50625f9

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‎

Lines changed: 2 additions & 2 deletions
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,addthe`keydown` listener:
7+
We've already got a`handleKeydown` function declared — now all we need to do isadda`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‎

Lines changed: 5 additions & 6 deletions
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.2em0.5em;
36-
border-top:5pxsolidrgba(255,255,255,0.5);
37-
border-left:5pxsolid
38-
rgba(255,255,255,0.5);
39-
border-right:5pxsolidrgba(0,0,0,0.2);
40-
border-bottom:5pxsolidrgba(0,0,0,0.2);
35+
background-color:#eeeeee;
36+
border-top:5pxsolid#f9f9f9;
37+
border-left:5pxsolid#f9f9f9;
38+
border-right:5pxsolid#aaaaaa;
39+
border-bottom:5pxsolid#aaaaaa;
4140
color:#555;
4241
}
4342
</style>

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

Lines changed: 5 additions & 6 deletions
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.2em0.5em;
36-
border-top:5pxsolidrgba(255,255,255,0.5);
37-
border-left:5pxsolid
38-
rgba(255,255,255,0.5);
39-
border-right:5pxsolidrgba(0,0,0,0.2);
40-
border-bottom:5pxsolidrgba(0,0,0,0.2);
35+
background-color:#eeeeee;
36+
border-top:5pxsolid#f9f9f9;
37+
border-left:5pxsolid#f9f9f9;
38+
border-right:5pxsolid#aaaaaa;
39+
border-bottom:5pxsolid#aaaaaa;
4140
color:#555;
4241
}
4342
</style>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp