Skip to content

Commit 082685f

Browse files
Rich-HarrisRich Harris
and
Rich Harris
authored
Content tweaks (sveltejs#260)
* make copy mobile-friendly * make file edit buttons more obvious * use a colour that works for light and dark modes * space --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 2b1610c commit 082685f

File tree

9 files changed

+39
-7
lines changed

9 files changed

+39
-7
lines changed

content/tutorial/01-svelte/01-introduction/01-welcome-to-svelte/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ This tutorial is split into four main parts:
2727

2828
Each section will present an exercise designed to illustrate a feature. Later exercises build on the knowledge gained in earlier ones, so it's recommended that you go from start to finish. If necessary, you can navigate via the menu above.
2929

30-
If you get stuck, you can click the `solve` button to the left of the editor. (It's disabled on sections like this one that don't include an exercise.) Try not to rely on it too much; you will learn faster by figuring out where to put each suggested code block and manually typing it in to the editor.
30+
If you get stuck, you can click the `solve` button <span class="desktop">to the left of the editor</span><span class="mobile">in the top right of the editor view</span>. (<span class="mobile">Use the toggle below to switch between tutorial and editor views. </span>The `solve` button is disabled on sections like this one that don't include an exercise.) Try not to rely on it too much; you will learn faster by figuring out where to put each suggested code block and manually typing it in to the editor.

content/tutorial/01-svelte/01-introduction/02-your-first-component/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ Inside the curly braces, we can put any JavaScript we want. Try changing `name`
2828

2929
```svelte
3030
<h1>Hello {name+++.toUpperCase()+++}!</h1>
31-
```
31+
```

content/tutorial/01-svelte/01-introduction/04-styling/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Just like in HTML, you can add a `<style>` tag to your component. Let's add some
99
1010
<style>
1111
+++ p {
12-
color: purple;
12+
color: goldenrod;
1313
font-family: 'Comic Sans MS', cursive;
1414
font-size: 2em;
1515
}+++

content/tutorial/01-svelte/01-introduction/04-styling/app-b/src/lib/App.svelte

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

33
<style>
44
p {
5-
color: purple;
5+
color: goldenrod;
66
font-family: 'Comic Sans MS', cursive;
77
font-size: 2em;
88
}

content/tutorial/01-svelte/01-introduction/05-nested-components/app-a/src/lib/App.svelte

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

33
<style>
44
p {
5-
color: purple;
5+
color: goldenrod;
66
font-family: 'Comic Sans MS', cursive;
77
font-size: 2em;
88
}

content/tutorial/01-svelte/01-introduction/05-nested-components/app-b/src/lib/App.svelte

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

88
<style>
99
p {
10-
color: purple;
10+
color: goldenrod;
1111
font-family: 'Comic Sans MS', cursive;
1212
font-size: 2em;
1313
}

content/tutorial/01-svelte/03-props/02-default-values/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ If we now add a second component _without_ an `answer` prop, it will fall back t
1414

1515
```svelte
1616
<Nested answer={42}/>
17-
+++<Nested/>+++
17+
+++<Nested />+++
1818
```
Lines changed: 3 additions & 0 deletions
Loading

src/routes/tutorial/[slug]/Sidebar.svelte

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,25 @@
143143
background: rgba(255, 62, 0, 0.1);
144144
}
145145
146+
.text :global([data-file]) {
147+
cursor: pointer;
148+
background-image: url($lib/icons/file-edit.svg);
149+
background-repeat: no-repeat;
150+
background-position: 0.5rem 50%;
151+
background-size: 1rem 1rem;
152+
padding-left: 2rem;
153+
}
154+
155+
@media (prefers-color-scheme: dark) {
156+
.text :global([data-file]) {
157+
background-image: url($lib/icons/file-edit-inline-dark.svg);
158+
}
159+
}
160+
161+
.text :global(.desktop) {
162+
display: none;
163+
}
164+
146165
footer {
147166
padding: 1rem 3rem;
148167
display: flex;
@@ -179,4 +198,14 @@
179198
border-radius: var(--sk-border-radius);
180199
line-height: 1;
181200
}
201+
202+
@media (min-width: 800px) {
203+
.text :global(.mobile) {
204+
display: none;
205+
}
206+
207+
.text :global(.desktop) {
208+
display: inline;
209+
}
210+
}
182211
</style>

0 commit comments

Comments
 (0)