Skip to content

Commit 640acb7

Browse files
committed
snippet markdown was not styled correctly
1 parent 1415e01 commit 640acb7

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

components/Step/StepMarkdown.vue

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div v-html="markdown" class="prose max-w-none dark:text-white"></div>
2+
<div v-html="markdown" class="prose dark:prose-dark max-w-none dark:text-white"></div>
33
</template>
44

55
<script>
@@ -31,8 +31,11 @@ export default {
3131
mode = this.detectMode(this.step.title)
3232
3333
}
34-
if (mode) {
3534
35+
if (mode === 'markdown') {
36+
return markdownIt.render(wrapBody);
37+
}
38+
if (mode) {
3639
wrapBody = "```" + mode + "\n"
3740
+ this.step.body + "\n"
3841
+ "```"

tailwind.config.js

+29-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
const colors = require('tailwindcss/colors')
2-
2+
const round = (num) =>
3+
num
4+
.toFixed(7)
5+
.replace(/(\.[0-9]+?)0+$/, '$1')
6+
.replace(/\.0$/, '')
7+
const em = (px, base) => `${round(px / base)}em`
38
module.exports = {
49
purge: [
510
"./components/**/*.{vue,js}",
@@ -12,13 +17,26 @@ module.exports = {
1217
theme: {
1318

1419
extend: {
15-
// typography: (theme) => ({
16-
// dark: {
17-
// css: {
18-
// color: '#fff'
19-
// }
20-
// }
21-
// }),
20+
typography: (theme) => ({
21+
dark: {
22+
css: {
23+
color: '#fff',
24+
h1: {
25+
color: theme('colors.gray.200'),
26+
fontSize: em(30, 14),
27+
}, h2: {
28+
color: theme('colors.gray.200'),
29+
fontSize: em(20, 14),
30+
}, h3: {
31+
color: theme('colors.gray.200'),
32+
fontSize: em(18, 14),
33+
}, h4: {
34+
color: theme('colors.gray.200'),
35+
fontSize: em(20, 14),
36+
},
37+
}
38+
}
39+
}),
2240
opacity: ['disabled'],
2341
fontFamily: {
2442
header: ["Rubik", "sans-serif"],
@@ -37,7 +55,9 @@ module.exports = {
3755
}
3856
},
3957
variants: {
40-
typography: ['dark']
58+
extend: {
59+
typography: ['dark']
60+
}
4161
},
4262
plugins: [
4363
require('@tailwindcss/typography'),

0 commit comments

Comments
 (0)