Skip to content

Commit f114857

Browse files
author
Jason Tame
committed
Conditionally add basic styling
1 parent a20ae46 commit f114857

File tree

1 file changed

+100
-2
lines changed

1 file changed

+100
-2
lines changed
Lines changed: 100 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<template>
2-
<div v-html="content" class="htmlCard__content"></div>
2+
<div
3+
v-html="content"
4+
class="htmlCard__content"
5+
:class="{htmlCard__basicStyles: withBasicStyles}"
6+
></div>
37
</template>
48

59
<script>
610
export default {
7-
props: ['content'],
11+
props: ['content', 'withBasicStyles'],
812
};
913
</script>
1014

@@ -14,4 +18,98 @@ export default {
1418
margin-bottom: 1em;
1519
}
1620
}
21+
22+
.htmlCard__basicStyles {
23+
a {
24+
color: #009cde;
25+
text-decoration: none;
26+
}
27+
28+
a:hover {
29+
text-decoration: underline;
30+
}
31+
32+
p,
33+
blockquote,
34+
ul,
35+
ol,
36+
dl,
37+
table,
38+
pre {
39+
margin: 15px 0;
40+
}
41+
42+
ul,
43+
ol {
44+
padding-left: 30px;
45+
}
46+
47+
li {
48+
list-style: disc;
49+
}
50+
51+
h1 {
52+
font-size: 2.5em;
53+
}
54+
55+
h2 {
56+
font-size: 2em;
57+
}
58+
59+
h3 {
60+
font-size: 1.5em;
61+
}
62+
63+
h4 {
64+
font-size: 1.2em;
65+
}
66+
67+
h5 {
68+
font-size: 1em;
69+
}
70+
71+
h6 {
72+
font-size: 1em;
73+
}
74+
75+
h1,
76+
h2,
77+
h3,
78+
h4,
79+
h5,
80+
h6 {
81+
font-weight: bold;
82+
line-height: 1.7;
83+
margin-bottom: 15px;
84+
}
85+
86+
h1 + p,
87+
h2 + p,
88+
h3 + p {
89+
margin-top: 10px;
90+
}
91+
92+
img {
93+
max-width: 100%;
94+
}
95+
96+
code,
97+
pre {
98+
background-color: #f8f8f8;
99+
border: 1px solid #ddd;
100+
border-radius: 3px;
101+
font-family: Consolas, 'Liberation Mono', Courier, monospace;
102+
font-size: 12px;
103+
margin: 0 2px;
104+
padding: 6px;
105+
white-space: pre;
106+
}
107+
108+
pre code {
109+
border: none;
110+
margin: 0;
111+
padding: 0;
112+
white-space: pre;
113+
}
114+
}
17115
</style>

0 commit comments

Comments
 (0)