| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- // Markdown 解析器主样式
- .markdown-viewer {
- font-size: 14px;
- // 标题样式
- .markdown-h1,
- .markdown-h2,
- .markdown-h3,
- .markdown-h4,
- .markdown-h5,
- .markdown-h6 {
- font-weight: 600;
- margin: 12px 0;
- color: #222;
- line-height: 1.4;
- }
- .markdown-h1 {
- font-size: 24px;
- border-bottom: 1px solid #eee;
- padding-bottom: 12px;
- }
- .markdown-h2 {
- font-size: 20px;
- border-bottom: 1px solid #eee;
- padding-bottom: 6;
- }
- .markdown-h3 {
- font-size: 18px;
- }
- .markdown-h4 {
- font-size: 16px;
- }
- .markdown-h5,
- .markdown-h6 {
- font-size: 12px;
- }
- // 段落样式
- .markdown-paragraph {
- margin: 12px 0;
- text-align: justify;
- }
- // 列表样式
- .markdown-list {
- padding-left: 12px;
- .markdown-list-item {
- margin: 12px 0;
- position: relative;
- }
- }
- .markdown-ul {
- .markdown-list-item::before {
- content: "•";
- position: absolute;
- left: -1em;
- color: #666;
- }
- }
- .markdown-ol {
- counter-reset: ol-counter;
- .markdown-list-item::before {
- counter-increment: ol-counter;
- content: counter(ol-counter) ".";
- position: absolute;
- left: -1.5em;
- color: #666;
- font-weight: 500;
- }
- }
- // 引用样式
- .markdown-quote {
- margin: 1em 0;
- padding: 0.8em 1em;
- border-left: 3px solid #4285f4;
- background-color: #f5f7fa;
- color: #555;
- border-radius: 0 4px 4px 0;
- font-style: italic;
- }
- // 代码块样式
- .markdown-code-block {
- margin: 0;
- padding: 1em;
- background-color: #f5f5f5;
- border-radius: 6px;
- font-family: "Menlo", "Monaco", "Consolas", monospace;
- font-size: 0.9em;
- overflow-x: auto;
- position: relative;
- // 代码语言标签
- .markdown-code-lang {
- display: block;
- margin-bottom: 0.5em;
- color: #888;
- font-size: 0.8em;
- text-transform: uppercase;
- letter-spacing: 0.5px;
- }
- .markdown-code {
- white-space: pre;
- color: #333;
- }
- }
- // 分隔线样式
- .markdown-hr {
- margin: 6px 0;
- height: 1px;
- background-color: #eee;
- border: none;
- }
- // 空行样式
- .markdown-br {
- height: 4px;
- }
- // 行内元素样式
- rich-text {
- strong {
- font-weight: 600;
- color: #222;
- }
- em {
- font-style: italic;
- color: #555;
- }
- code {
- background-color: #f0f0f0;
- padding: 0.2em 0.4em;
- border-radius: 3px;
- font-family: "Menlo", "Monaco", "Consolas", monospace;
- font-size: 0.9em;
- margin: 0 2px;
- }
- a {
- color: #4285f4;
- text-decoration: none;
- padding-bottom: 1px;
- border-bottom: 1px dotted #4285f4;
- transition: all 0.2s;
- &:hover {
- color: #3367d6;
- border-bottom: 1px solid #3367d6;
- }
- }
- img {
- max-width: 100%;
- height: auto;
- border-radius: 4px;
- margin: 1em 0;
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
- }
- }
- }
- .markdown-list { margin: 8px 0; }
- .markdown-ul { list-style-type: disc; padding-left: 20px; }
- .markdown-ol { list-style-type: decimal; padding-left: 20px; }
- .markdown-list-item { margin: 4px 0; }
- .markdown-list {
- margin: 2px 0;
- padding-left: 12px;
-
- &.depth-0 { padding-left: 12px; padding-bottom: 12px;}
- &.depth-1 { padding-left: 24px; }
- &.depth-2 { padding-left: 36px; }
- &.depth-3 { padding-left: 48px; }
-
- // &.markdown-ul {
- // list-style-type: disc;
-
- // &.depth-1 { list-style-type: circle; }
- // &.depth-2 { list-style-type: square; }
- // }
-
- // &.markdown-ol {
- // list-style-type: decimal;
-
- // &.depth-1 { list-style-type: lower-alpha; }
- // &.depth-2 { list-style-type: lower-roman; }
- // }
- }
- .markdown-list-item {
- margin: 4px 0;
- }
- // 深色模式适配 (可根据需要启用)
- // @media (prefers-color-scheme: dark) {
- // .markdown-viewer {
- // color: #ddd;
- // background-color: #1a1a1a;
- //
- // .markdown-h1,
- // .markdown-h2,
- // .markdown-h3,
- // .markdown-h4,
- // .markdown-h5,
- // .markdown-h6 {
- // color: #fff;
- // border-bottom-color: #333;
- // }
- //
- // .markdown-quote {
- // background-color: #2d2d2d;
- // color: #bbb;
- // border-left-color: #5294e2;
- // }
- //
- // .markdown-code-block {
- // background-color: #2d2d2d;
- //
- // .markdown-code {
- // color: #ccc;
- // }
- // }
- //
- // .markdown-hr {
- // background-color: #333;
- // }
- //
- // rich-text {
- // strong {
- // color: #fff;
- // }
- //
- // em {
- // color: #bbb;
- // }
- //
- // code {
- // background-color: #333;
- // }
- //
- // a {
- // color: #5294e2;
- // border-bottom-color: #5294e2;
- //
- // &:hover {
- // color: #6aa1e8;
- // border-bottom-color: #6aa1e8;
- // }
- // }
- // }
- // }
- // }
|