@uiw/react-markdown-preview
Version:
React component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub Markdown style.
180 lines (172 loc) • 3.19 kB
text/less
.wmde-markdown {
font-size: 16px;
line-height: 1.5;
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
> :first-child {
margin-top: 0 ;
}
> :last-child {
margin-bottom: 0 ;
}
code[class*="language-"], pre[class*="language-"] {
color: black;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
hyphens: none;
}
pre code {
background: none;
overflow-wrap: normal;
white-space: inherit;
tab-size: 2;
padding: 16px;
font-size: 95%;
line-height: 1.5;
display: block;
text-shadow: 0 1px #fff;
}
pre {
margin-bottom: 18px;
font-size: 85%;
line-height: 1.45;
position: relative;
overflow-x: auto;
background-color: #f6f8fa;
border-radius: 3px;
}
code, tt {
background-color: rgba(27,31,35,.05);
border-radius: 3px;
font-size: 85%;
margin: 0;
padding: .2em .4em;
}
pre, code, tt {
font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;
}
img {
max-width: 100%;
}
input {
vertical-align: middle;
margin: 0 .2em .25em -1.6em;
& + p {
display: inline;
}
}
h1, h2 {
border-bottom: 1px solid #eaecef;
padding-bottom: .3em;
}
h1, h2, h3, h4, h5, h6 {
font-weight: 600;
line-height: 1.25;
margin-bottom: 16px;
margin-top: 24px;
.anchor {
float: left;
padding-right: 4px;
margin-left: -20px;
line-height: 1;
}
.octicon-link {
visibility: hidden;
vertical-align: middle;
}
&:hover .octicon-link {
visibility: visible;
}
}
h1 {
font-size: 2em;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.25em;
}
h4 {
font-size: 1em;
}
h5 {
font-size: .875em;
}
h6 {
font-size: .85em;
}
ol, ul {
padding-left: 2em;
& > p {
margin-bottom: 0;
}
}
ul {
margin-bottom: 16px;
margin-top: 0;
list-style: initial;
}
> blockquote, > blockquote blockquote {
margin: 0;
border-left: .25em solid #dfe2e5;
color: #6a737d;
padding: 0 1em;
> :last-child {
margin-bottom: 0;
}
> :first-child {
margin-top: 0;
}
}
hr {
margin: 1.5em auto;
border: 0;
border-top: 2px dotted #eee;
height: 1px;
}
> table, > blockquote table {
display: block;
overflow: auto;
width: 100%;
border-collapse: collapse;
border-spacing: 0;
font-size: 14px;
tr {
background-color: #fff;
border-top: 1px solid #c6cbd1;
}
td, th {
border: 1px solid #dfe2e5;
padding: 6px 13px;
}
}
blockquote, details, dl, ol, p, pre, table, ul {
margin-bottom: 16px;
margin-top: 0;
}
a {
color: #0366d6;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
.namespace {
opacity: .7;
}
.token.important {
font-weight: normal;
}
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
}