Skip to content

Commit 1640493

Browse files
authored
redesign docs page (#242)
* redesign docs page * fix * fix * fix * link to discord * tighten up * oops * make arrows slightly brighter
1 parent cb79b16 commit 1640493

File tree

6 files changed

+79
-25
lines changed

6 files changed

+79
-25
lines changed

apps/svelte.dev/src/routes/blog/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
min-height: calc(100vh - var(--sk-nav-height) - var(--sk-banner-bottom-height));
3838
padding: var(--sk-page-padding-top) var(--sk-page-padding-side) 6rem var(--sk-page-padding-side);
3939
max-width: var(--sk-page-main-width);
40+
box-sizing: content-box;
4041
margin: 0 auto;
4142
text-wrap: balance;
4243
}

apps/svelte.dev/src/routes/blog/[slug]/+page.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545

4646
<style>
4747
.post {
48-
padding: var(--sk-page-padding-top) var(--sk-page-padding-side) 6rem var(--sk-page-padding-side);
48+
padding: var(--sk-page-padding-top) var(--sk-page-padding-side);
4949
max-width: var(--sk-page-main-width);
50+
box-sizing: content-box;
5051
margin: 0 auto;
5152
}
5253

apps/svelte.dev/src/routes/docs/+page.svelte

Lines changed: 72 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,37 +57,87 @@
5757
</script>
5858

5959
<div class="page">
60-
<div>
61-
<h2>Svelte</h2>
62-
<p>Svelte is a compiler-based framework for creating fast and efficient UIs.</p>
63-
<a href="/docs/svelte">read the docs</a>
64-
</div>
65-
<div>
66-
<h2>SvelteKit</h2>
67-
<p>
68-
SvelteKit is a framework for rapidly developing robust, performant web applications using
69-
Svelte
70-
</p>
71-
<a href="/docs/kit">read the docs</a>
60+
<h1>Documentation</h1>
61+
<p>
62+
Head to the <a href="/docs/svelte">Svelte</a> or <a href="/docs/kit">SvelteKit</a> reference docs,
63+
or choose your adventure:
64+
</p>
65+
66+
<div class="options">
67+
<a href="/tutorial">
68+
<h2>I&rsquo;m brand new here</h2>
69+
<p>
70+
We recommend starting with the interactive tutorial, which will teach you how to use Svelte
71+
right here in your browser.
72+
</p>
73+
</a>
74+
75+
<a href="/docs/svelte/migrating">
76+
<h2>I&rsquo;m migrating an app from Svelte 4</h2>
77+
<p>
78+
If you&rsquo;re already experienced with an older version of Svelte, the migration guide
79+
will bring you up to speed on the changes in Svelte 5.
80+
</p>
81+
</a>
82+
83+
<a href="/playground">
84+
<h2>I just want to try it out</h2>
85+
<p>
86+
Head over to the playground to see examples, create your own Svelte apps in the browser, and
87+
share them with other people.
88+
</p>
89+
</a>
90+
91+
<a href="/chat" class="external">
92+
<h2>Help! I'm stuck</h2>
93+
<p>
94+
Join our Discord server where you can hang out with fellow Svelte users and ask them
95+
questions. It's like an LLM but with people.
96+
</p>
97+
</a>
7298
</div>
7399
</div>
74100

75101
<style>
76102
.page {
77103
padding: var(--sk-page-padding-top) var(--sk-page-padding-side);
78-
display: grid;
79-
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
80-
justify-items: center;
81-
max-width: 100rem;
104+
max-width: var(--sk-page-main-width);
105+
box-sizing: content-box;
82106
margin: auto;
107+
text-wrap: balance;
108+
}
109+
110+
.options a {
111+
display: block;
112+
color: var(--sk-text-2);
113+
margin: 1em -2em;
114+
padding: 2em;
115+
background-color: var(--sk-back-1);
116+
border-radius: var(--sk-border-radius);
83117
84-
& > div {
85-
padding: 2rem;
86-
max-width: 50rem;
118+
&:hover {
119+
background-color: var(--sk-back-2);
120+
filter: drop-shadow(1px 2px 4px rgb(0 0 0 / 0.1));
121+
text-decoration: none;
122+
123+
h2 {
124+
text-decoration: underline;
125+
}
87126
}
88-
}
89127
90-
a {
91-
font-size: var(--sk-font-size-body-small);
128+
h2 {
129+
padding-right: 4rem;
130+
background: url(./arrow-right.svg) no-repeat 100% 50%;
131+
background-size: 3rem;
132+
133+
.external & {
134+
background-image: url(./external-link.svg);
135+
background-size: 3rem;
136+
}
137+
}
138+
139+
p:last-child {
140+
margin-bottom: 0;
141+
}
92142
}
93143
</style>
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

packages/site-kit/src/lib/styles/tokens.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
--sk-page-padding-side: 2.4rem;
1919
--sk-thick-border-width: 0.3rem;
2020
--sk-border-radius: 0.4rem;
21-
--sk-page-main-width: 80rem;
21+
--sk-page-main-width: 84rem;
2222
--sk-banner-bottom-height: 0px;
2323

2424
/* typography */
@@ -37,7 +37,7 @@
3737
--sk-font-size-ui-large: 3rem; /* TODO add regular/small */
3838
--sk-font-size-code: 1.4rem;
3939

40-
--sk-line-max-width: 84rem;
40+
--sk-line-max-width: 84rem; /* TODO can this be merged with --sk-page-main-width?
4141
4242
/* Base colors */
4343
--sk-theme-1-hsl: 12, 93%, 43%;

0 commit comments

Comments
 (0)