Skip to content

Commit 56ec74c

Browse files
authored
Add styling (#40)
1 parent fee6e26 commit 56ec74c

File tree

3 files changed

+69
-4
lines changed

3 files changed

+69
-4
lines changed

src/lib/styles/app.css

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
:root {
2+
--max-width: 1024px;
3+
--min-width: 320px;
4+
--font-size: 18px;
5+
--font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
6+
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
7+
--line-height: 1.6;
8+
--gap: 1rem;
9+
--color: #333;
10+
--bg: #eee;
11+
--bg-code: hsla(0, 0%, 0%, 0.1);
12+
}
13+
14+
*,
15+
*::before,
16+
*::after {
17+
box-sizing: border-box;
18+
}
19+
20+
body {
21+
max-width: var(--max-width);
22+
min-width: var(--min-width);
23+
margin: 0 auto;
24+
padding: var(--gap);
25+
background: var(--bg);
26+
color: var(--color);
27+
font-family: var(--font-family);
28+
font-size: var(--font-size);
29+
line-height: var(--line-height);
30+
-webkit-font-smoothing: antialiased;
31+
scrollbar-gutter: stable;
32+
}
33+
34+
h1,
35+
h2 {
36+
max-width: 50ch;
37+
text-wrap: balance;
38+
line-height: 1;
39+
}
40+
41+
h2 {
42+
padding-block-start: calc(var(--gap) * 0.7);
43+
}
44+
45+
p {
46+
max-width: 77ch;
47+
text-wrap: pretty;
48+
}
49+
50+
pre code {
51+
padding-block: calc(var(--gap) / 5);
52+
padding-inline: calc(var(--gap) / 2);
53+
background-color: var(--bg-code);
54+
}
55+
56+
code {
57+
font-weight: 700;
58+
padding-inline: calc(var(--gap) / 3);
59+
background-color: var(--bg-code);
60+
}

src/routes/+layout.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script>
2+
import '$lib/styles/app.css';
3+
</script>
4+
5+
<main>
6+
<slot />
7+
</main>

src/routes/+page.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@
1818

1919
<h2>Installation</h2>
2020

21-
<pre><code>
22-
npm install {npmPackage}
23-
</code></pre>
21+
<pre><code>npm install {npmPackage}</code></pre>
2422

2523
<h2>Getting Started</h2>
2624

2725
<p>
2826
Add the <code>handleHttpResponseHeaders</code> Hook in <code>src/hooks.server.ts</code> file.
29-
Refer to the repo
27+
Refer to the repository's
3028
<a
3129
href="https://github.com/kevinobee/sveltekit-security-headers?tab=readme-ov-file#getting-started"
3230
>README</a

0 commit comments

Comments
 (0)