Skip to content

Commit 13e169c

Browse files
authored
Merge pull request #43 from tomoam/update-up-to-20230522
2023/05/22 迄の更新に追従
2 parents e594910 + 3114bc5 commit 13e169c

File tree

11 files changed

+495
-406
lines changed

11 files changed

+495
-406
lines changed

content/tutorial/01-svelte/05-events/04-component-events/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ title: Component events
2828
<Inner +++on:message={handleMessage}+++ />
2929
```
3030

31-
> イベント名を他のものに変更してみることもできます。例えば、`Inner.svelte``dispatch('message')``dispatch('greet')` に変更し、`App.svelte` の属性名を `on:message` から `on:greet` に変更します。
31+
> イベント名を別の名前に変更してみることもできます。例えば、`Inner.svelte``dispatch('message', {...})``dispatch('greet', {...})` に変更し、`App.svelte` の属性名を `on:message` から `on:greet` に変更します。

content/tutorial/02-advanced-svelte/02-transitions/08-key-blocks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Key blocks
44

55
Key ブロックは、式の値が変更されたときにその中身を破棄して再作成します。これは、要素がDOMに出入りしたときだけでなく、値が変化したときにトランジションしたい場合に便利です。
66

7-
ここでは例えば、`transition.js``typewriter` トランジションを、ローディングメッセージが変わる度に再生させたいと思います`<p>` 要素を key ブロックで囲みます。
7+
ここでは例えば、`transition.js``typewriter` トランジションを、ローディングメッセージが変わる度に、つまり `i` が変わる度に再生させたいと思います`<p>` 要素を key ブロックで囲みます。
88

99
```svelte
1010
/// file: App.svelte

content/tutorial/02-advanced-svelte/05-bindings/03-media-elements/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ title: Media elements
44

55
`<audio>` 要素と `<video>` 要素のプロパティをバインドすることができるので、(例えば) `AudioPlayer.svelte` のようなカスタムのプレーヤー UI をとても簡単に作ることができます。
66

7-
最初に、`<audio>` 要素とそのバインディングを追加します (`duration``paused` は短縮形を使います):
7+
最初に、`<audio>` 要素とそのバインディングを追加します (`src``duration``paused` は短縮形を使います):
88

99
```svelte
1010
/// file: AudioPlayer.svelte
1111
<div class="player" class:paused>
1212
+++ <audio
13-
src={src}
13+
{src}
1414
bind:currentTime={time}
1515
bind:duration
1616
bind:paused
@@ -53,7 +53,7 @@ function seek(e) {
5353
```svelte
5454
/// file: AudioPlayer.svelte
5555
<audio
56-
src={src}
56+
{src}
5757
bind:currentTime={time}
5858
bind:duration
5959
bind:paused

content/tutorial/02-advanced-svelte/05-bindings/03-media-elements/app-b/src/lib/AudioPlayer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<div class="player" class:paused>
2121
<audio
22-
src={src}
22+
{src}
2323
bind:currentTime={time}
2424
bind:duration
2525
bind:paused

content/tutorial/02-advanced-svelte/05-bindings/04-dimensions/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ title: Dimensions
77
```svelte
88
/// file: App.svelte
99
<div +++bind:clientWidth={w} bind:clientHeight={h}+++>
10-
<span style="font-size: {size}px">{text}</span>
10+
<span style="font-size: {size}px" contenteditable>{text}</span>
11+
<span class="size">{w} x {h}px</span>
1112
</div>
1213
```
1314

content/tutorial/common/src/app.html

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
--link-hover: hsl(208, 77%, 55%);
2020
--link-active: hsl(208, 77%, 40%);
2121
--border-radius: 4px;
22-
--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
23-
--font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
22+
--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
23+
'Open Sans', 'Helvetica Neue', sans-serif;
24+
--font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas,
25+
'DejaVu Sans Mono', monospace;
2426
background: var(--bg-1);
2527
color: var(--fg-1);
2628
font-family: var(--font);
@@ -107,14 +109,17 @@
107109
opacity: 0.4;
108110
}
109111

110-
input, textarea, select {
112+
input,
113+
textarea,
114+
select {
111115
padding: 0.5rem;
112116
border: 1px solid var(--bg-2);
113117
border-radius: var(--border-radius);
114118
box-sizing: border-box;
115119
}
116120

117-
input, textarea {
121+
input,
122+
textarea {
118123
background: var(--bg-1);
119124
}
120125

@@ -160,7 +165,7 @@
160165
text-decoration: none;
161166
}
162167

163-
nav a[aria-current="true"] {
168+
nav a[aria-current='true'] {
164169
border-bottom: 2px solid;
165170
}
166171

@@ -208,7 +213,7 @@
208213
border-radius: 5px;
209214
user-select: none;
210215
background: var(--bg-1);
211-
filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.1));
216+
filter: drop-shadow(2px 3px 6px rgba(0, 0, 0, 0.1));
212217
transition: filter 0.2s, opacity 0.2s;
213218
}
214219

@@ -236,22 +241,27 @@
236241
opacity: 1;
237242
}
238243

239-
@media (prefers-color-scheme: dark) {
240-
body {
241-
--bg-1: hsl(0, 0%, 18%);
242-
--bg-2: hsl(0, 0%, 30%);
243-
--bg-3: hsl(0, 0%, 40%);
244-
--fg-1: hsl(0, 0%, 90%);
245-
--fg-2: hsl(0, 0%, 70%);
246-
--fg-3: hsl(0, 0%, 60%);
247-
--link: hsl(206, 96%, 72%);
248-
--link-hover: hsl(206, 96%, 78%);
249-
--link-active: hsl(206, 96%, 64%);
250-
}
244+
body.dark {
245+
--bg-1: hsl(0, 0%, 18%);
246+
--bg-2: hsl(0, 0%, 30%);
247+
--bg-3: hsl(0, 0%, 40%);
248+
--fg-1: hsl(0, 0%, 90%);
249+
--fg-2: hsl(0, 0%, 70%);
250+
--fg-3: hsl(0, 0%, 60%);
251+
--link: hsl(206, 96%, 72%);
252+
--link-hover: hsl(206, 96%, 78%);
253+
--link-active: hsl(206, 96%, 64%);
251254
}
252255
</style>
253256
</head>
254257
<body>
255258
<div style="display: contents">%sveltekit.body%</div>
259+
260+
<script>
261+
const theme = new URL(window.location).searchParams.get('theme');
262+
263+
document.body.classList.remove('light', 'dark');
264+
document.body.classList.add(theme || 'light');
265+
</script>
256266
</body>
257267
</html>

jsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"esModuleInterop": true,
77
"forceConsistentCasingInFileNames": true,
88
"lib": ["es2020", "DOM"],
9-
"moduleResolution": "node",
9+
"moduleResolution": "bundler",
1010
"module": "es2022",
1111
"resolveJsonModule": true,
1212
"skipLibCheck": true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@playwright/test": "^1.31.2",
1717
"@sveltejs/adapter-vercel": "2.3.1",
1818
"@sveltejs/kit": "^1.15.4",
19-
"@sveltejs/site-kit": "^4.0.1",
19+
"@sveltejs/site-kit": "^5.0.4",
2020
"@types/diff": "^5.0.2",
2121
"@types/marked": "^4.0.8",
2222
"@types/prismjs": "^1.26.0",

0 commit comments

Comments
 (0)