kotii-markdown-render 1.0.0-beta.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -0
- package/dist/index.cjs +667 -0
- package/dist/index.mjs +623 -0
- package/index.js +2 -0
- package/package.json +63 -0
- package/src/components/MarkdownAd/index.jsx +12 -0
- package/src/components/MarkdownDemo/index.jsx +7 -0
- package/src/components/MarkdownElement/index.jsx +24 -0
- package/src/components/MarkdownHeader/index.jsx +110 -0
- package/src/components/MarkdownRender/index.jsx +186 -0
- package/src/components/MarkdownSidebar/index.jsx +27 -0
- package/src/components/MarkdownTOC/index.jsx +98 -0
- package/src/components/MarkdownVideo/index.jsx +15 -0
- package/src/components/StandardComponent/index.jsx +18 -0
- package/src/components/StyledMarkdown/index.jsx +189 -0
- package/src/components/index.js +2 -0
- package/src/index.js +2 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import styled from "kotii-styled";
|
|
2
|
+
|
|
3
|
+
const GoogleFonts = styled.div`
|
|
4
|
+
@import url("https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap");
|
|
5
|
+
@import url("https://fonts.googleapis.com/css2?family=Pangolin&display=swap");
|
|
6
|
+
`;
|
|
7
|
+
const StyledMarkdown = styled(GoogleFonts)(() => ({
|
|
8
|
+
fontFamily: '"Roboto", sans-serif',
|
|
9
|
+
"& h1": {
|
|
10
|
+
color: "red",
|
|
11
|
+
margin: "10px 0",
|
|
12
|
+
fontSize: "3rem",
|
|
13
|
+
lineHeight: "3.5rem",
|
|
14
|
+
fontWeight: 900,
|
|
15
|
+
},
|
|
16
|
+
"& h1, h2, h3, h4, h5, h6": { textTransform: "capitalize" },
|
|
17
|
+
"& table": {
|
|
18
|
+
minWidth: "600px",
|
|
19
|
+
border: "2px solid #2a2f36",
|
|
20
|
+
margin: "20px auto",
|
|
21
|
+
width: "100%",
|
|
22
|
+
borderSpacing: "0",
|
|
23
|
+
borderCollapse: "collapse",
|
|
24
|
+
backgroundColor: "#fff",
|
|
25
|
+
},
|
|
26
|
+
"& table thead": {
|
|
27
|
+
background: "#2a2f36",
|
|
28
|
+
color: "#fff",
|
|
29
|
+
textAlign: "left",
|
|
30
|
+
fontWeight: 600,
|
|
31
|
+
},
|
|
32
|
+
"& table thead th": { fontWeight: 600 },
|
|
33
|
+
"& table td,\ntable th": {
|
|
34
|
+
padding: "10px",
|
|
35
|
+
fontSize: "16px",
|
|
36
|
+
fontWeight: 400,
|
|
37
|
+
},
|
|
38
|
+
"& table tr:nth-child(2n)": { background: "#f5f7fa" },
|
|
39
|
+
"& pre": {
|
|
40
|
+
// background: "#eee",
|
|
41
|
+
//background: "#001E3C;",
|
|
42
|
+
background: "#20354A",
|
|
43
|
+
// borderLeft: "5px solid #9684A3",
|
|
44
|
+
borderRadius: "10px",
|
|
45
|
+
padding: "10px",
|
|
46
|
+
letterSpacing: ".5px",
|
|
47
|
+
fontSize: "10pt",
|
|
48
|
+
// color: "#96b38a",
|
|
49
|
+
color: "white",
|
|
50
|
+
fontWeight: "bold",
|
|
51
|
+
},
|
|
52
|
+
// "& pre::-webkit-scrollbar": {
|
|
53
|
+
// backgroundColor: "#DED7E6",
|
|
54
|
+
// height: "10px",
|
|
55
|
+
// },
|
|
56
|
+
// "& pre::-webkit-scrollbar-thumb": {
|
|
57
|
+
// background: "#9684A3",
|
|
58
|
+
// borderTopRightRadius: "10px",
|
|
59
|
+
// },
|
|
60
|
+
|
|
61
|
+
"& pre code": {
|
|
62
|
+
display: "block",
|
|
63
|
+
background: "none",
|
|
64
|
+
whiteSpace: "pre",
|
|
65
|
+
WebkitOverflowScrolling: "touch",
|
|
66
|
+
overflowX: "scroll",
|
|
67
|
+
maxWidth: "100%",
|
|
68
|
+
minWidth: "100px",
|
|
69
|
+
padding: "0",
|
|
70
|
+
fontSize: "15px",
|
|
71
|
+
fontFamily: "MyFancyCustomFont, monospace",
|
|
72
|
+
},
|
|
73
|
+
"& code": {
|
|
74
|
+
fontFamily: "MyFancyCustomFont, monospace",
|
|
75
|
+
fontSize: "inherit",
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
"& ol": {
|
|
79
|
+
margin: "0 0 1em 0",
|
|
80
|
+
padding: "0",
|
|
81
|
+
counterReset: "li",
|
|
82
|
+
listStyle: "none",
|
|
83
|
+
},
|
|
84
|
+
"& ol li": {
|
|
85
|
+
display: "block",
|
|
86
|
+
overflow: "hidden",
|
|
87
|
+
position: "relative",
|
|
88
|
+
paddingLeft: "50px",
|
|
89
|
+
minHeight: "35px",
|
|
90
|
+
margin: "10px 0px",
|
|
91
|
+
paddingTop: "4px",
|
|
92
|
+
},
|
|
93
|
+
"& ol li:before": {
|
|
94
|
+
position: "absolute",
|
|
95
|
+
top: "0px",
|
|
96
|
+
left: "0px",
|
|
97
|
+
border: "1px solid #000",
|
|
98
|
+
backgroundColor: "#d5d5d5",
|
|
99
|
+
borderRadius: "50%",
|
|
100
|
+
width: "30px",
|
|
101
|
+
height: "30px",
|
|
102
|
+
lineHeight: "30px",
|
|
103
|
+
textAlign: "center",
|
|
104
|
+
fontSize: "12px",
|
|
105
|
+
fontWeight: 700,
|
|
106
|
+
color: "#000",
|
|
107
|
+
content: "counter(li)",
|
|
108
|
+
counterIncrement: "li",
|
|
109
|
+
},
|
|
110
|
+
"& ul li": {
|
|
111
|
+
color: "green",
|
|
112
|
+
listStyle: "none",
|
|
113
|
+
position: "relative",
|
|
114
|
+
paddingLeft: "50px",
|
|
115
|
+
lineHeight: 2,
|
|
116
|
+
fontSize: "16px",
|
|
117
|
+
},
|
|
118
|
+
"& ul li:before": {
|
|
119
|
+
position: "absolute",
|
|
120
|
+
left: "0",
|
|
121
|
+
color: "red",
|
|
122
|
+
fontSize: "32px",
|
|
123
|
+
content: '"\\f111"',
|
|
124
|
+
},
|
|
125
|
+
"p > code,\nli > code,\ndd > code,\ntd > code": {
|
|
126
|
+
background: "#ffeff0",
|
|
127
|
+
wordWrap: "break-word",
|
|
128
|
+
boxDecorationBreak: "clone",
|
|
129
|
+
padding: ".1rem .3rem .2rem",
|
|
130
|
+
borderRadius: ".2rem",
|
|
131
|
+
},
|
|
132
|
+
// "& ul li.two:before": { content: '"\\f00c"' },
|
|
133
|
+
// "& ul li.three:before": { content: '"\\f10c"' },
|
|
134
|
+
// "& ul li.four:before": { content: '"\\f004"' },
|
|
135
|
+
// "& ul li.five:before": { content: '"\\f1e2"' },
|
|
136
|
+
// "& ul li.six:before": { content: '"\\f0e7"' },
|
|
137
|
+
// "& ul li:hover:before": { color: "#fff" },
|
|
138
|
+
"& p": {
|
|
139
|
+
textAlign: "justify",
|
|
140
|
+
hyphens: "auto",
|
|
141
|
+
// fontFamily: '"Pangolin", sans-serif',
|
|
142
|
+
},
|
|
143
|
+
"& p:first-of-type": { fontSize: "1.1rem" },
|
|
144
|
+
"& p:first-of-type:first-letter": {
|
|
145
|
+
fontSize: "2.2rem",
|
|
146
|
+
fontWeight: "bold",
|
|
147
|
+
float: "left",
|
|
148
|
+
display: "inline-block",
|
|
149
|
+
marginTop: "0.5rem",
|
|
150
|
+
paddingRight: "0.15rem",
|
|
151
|
+
color: "white",
|
|
152
|
+
backgroundColor: "red",
|
|
153
|
+
padding: "1.2rem 0.5rem",
|
|
154
|
+
marginRight: "0.5rem",
|
|
155
|
+
},
|
|
156
|
+
"& p:first-of-type:first-line": { fontWeight: "bold" },
|
|
157
|
+
"& blockquote": {
|
|
158
|
+
fontSize: "1.4em",
|
|
159
|
+
width: "60%",
|
|
160
|
+
margin: "50px auto",
|
|
161
|
+
fontFamily: "Open Sans",
|
|
162
|
+
fontStyle: "italic",
|
|
163
|
+
color: "#555555",
|
|
164
|
+
padding: "1.2em 30px 1.2em 75px",
|
|
165
|
+
borderLeft: "8px solid #78C0A8",
|
|
166
|
+
lineHeight: 1.6,
|
|
167
|
+
position: "relative",
|
|
168
|
+
background: "#EDEDED",
|
|
169
|
+
},
|
|
170
|
+
"& blockquote::before": {
|
|
171
|
+
fontFamily: "Arial",
|
|
172
|
+
content: '"\\201C"',
|
|
173
|
+
color: "#78C0A8",
|
|
174
|
+
fontSize: "4em",
|
|
175
|
+
position: "absolute",
|
|
176
|
+
left: "10px",
|
|
177
|
+
top: "-10px",
|
|
178
|
+
},
|
|
179
|
+
"& blockquote::after": { content: "''" },
|
|
180
|
+
"& blockquote span": {
|
|
181
|
+
display: "block",
|
|
182
|
+
color: "#333333",
|
|
183
|
+
fontStyle: "normal",
|
|
184
|
+
fontWeight: "bold",
|
|
185
|
+
marginTop: "1em",
|
|
186
|
+
},
|
|
187
|
+
}));
|
|
188
|
+
|
|
189
|
+
export { StyledMarkdown };
|
package/src/index.js
ADDED