Files
qiming/qiming-mobile/subpackages/uni_modules/mp-html/components/mp-html/styles/markdown.scss

114 lines
2.1 KiB
SCSS

$mdZoom: 1.143;
$lineHeight: calc($mdZoom * 25px);
$fontWeightStrong: 600;
/* Markdown 通用样式 */
:deep(.md-p) {
margin-block-start: 1em;
margin-block-end: 1em;
line-height: 1.5;
strong {
font-weight: $fontWeightStrong;
}
}
:deep(.md-table),
:deep(.md-blockquote) {
margin-bottom: 16px;
}
:deep(.md-table) {
box-sizing: border-box;
display: table;
width: max-content;
min-width: 100%;
overflow: auto;
border-spacing: 0;
border-collapse: collapse;
}
:deep(.md-tr) {
background-color: #fff;
border-top: 1px solid #c6cbd1;
}
.md-table .md-tr:nth-child(2n) {
background-color: #f6f8fa;
}
:deep(.md-th),
:deep(.md-td) {
padding: 6px 13px !important;
border: 1px solid #dfe2e5;
}
:deep(.md-th) {
font-weight: 600;
}
:deep(.md-blockquote) {
padding: 0 1em;
color: #6a737d;
border-left: 0.25em solid #dfe2e5;
}
:deep(.md-code),
:deep(.md-code code) {
display: inline-block !important;
padding: 0.2em 0.4em;
font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
font-size: 85%;
background-color: rgba(27, 31, 35, 0.05);
border-radius: 3px;
word-break: break-all;
overflow-wrap: anywhere;
}
:deep(.md-pre .md-code) {
padding: 0;
font-size: 100%;
background: transparent;
border: 0;
}
:deep(.md-hr) {
height: 0.5px;
border: none;
margin: 30rpx 0;
background-color: #d9d9d9;
}
/**
H1 20px H2 18px H3 16px H4 16px H5 16px
**/
:deep(.md-h1) {
font-size: 20px;
border-bottom: 2rpx solid #d9d9d9;
padding-bottom: .3em;
line-height: 1.5;
font-weight: $fontWeightStrong;
margin: calc($mdZoom * 16px) 0 calc($mdZoom * 12px) 0;
}
:deep(.md-h2) {
font-size: 18px;
font-weight: $fontWeightStrong;
line-height: 1.5;
margin: calc($mdZoom * 16px) 0 calc($mdZoom * 12px) 0;
}
:deep(.md-h3),
:deep(.md-h4),
:deep(.md-h5) {
font-size: 16px;
font-weight: $fontWeightStrong;
line-height: $lineHeight;
margin: calc($mdZoom * 16px) 0 calc($mdZoom * 12px) 0;
}
:deep(.md-h6) {
font-size: 14px;
font-weight: $fontWeightStrong;
line-height: $lineHeight;
margin: calc($mdZoom * 16px) 0 calc($mdZoom * 12px) 0;
}