Skip to content

Commit 92175a6

Browse files
committed
feat: Style MDSveX and wrap with layout
1 parent e9e1b07 commit 92175a6

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

postcss.config.cjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
22
plugins: {
3+
"tailwindcss/nesting": {},
34
tailwindcss: {},
45
autoprefixer: {},
56
},
6-
}
7+
};

src/app.css

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
11
@tailwind base;
22
@tailwind components;
33
@tailwind utilities;
4+
5+
.markdown {
6+
h1 {
7+
@apply text-4xl my-4;
8+
}
9+
10+
p {
11+
@apply mt-2;
12+
}
13+
14+
a {
15+
@apply text-amber-700 underline;
16+
}
17+
18+
a:hover {
19+
@apply text-amber-900;
20+
}
21+
22+
a:active {
23+
@apply text-amber-600;
24+
}
25+
}

src/layouts/MarkdownLayout.svelte

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="markdown">
2+
<slot />
3+
</div>

svelte.config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ const config = {
8888
// See the available options at https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md
8989

9090
// options passed to svelte.preprocess (https://svelte.dev/docs#compile-time-svelte-preprocess)
91-
preprocess: [mdsvex(), sveltePreprocess()],
91+
preprocess: [
92+
mdsvex({
93+
layout: "./src/layouts/MarkdownLayout.svelte",
94+
}),
95+
sveltePreprocess(),
96+
],
9297
};
9398

9499
export default config;

0 commit comments

Comments
 (0)