Skip to content

Commit

Permalink
💄 导出微信公众号和的高亮样式
Browse files Browse the repository at this point in the history
  • Loading branch information
Achuan-2 committed Nov 26, 2024
1 parent d6ffa24 commit 6b1748c
Showing 1 changed file with 92 additions and 61 deletions.
153 changes: 92 additions & 61 deletions style/export.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* ---------------------------------------导出微信文章和pdf样式-----------------------------------*/
/* 导出微信文章设置默认字体 */
.protyle-preview>.b3-typography {
Expand All @@ -14,22 +13,23 @@
}

[data-theme-mode="light"] .protyle-preview>.b3-typography h1,
#preview .protyle-wysiwyg .h1{
#preview .protyle-wysiwyg .h1 {
font-weight: bold;
border-bottom: 2px solid rgba(15, 76, 129, 1);
text-align: center;
color: rgba(15, 76, 129, 1);

}
.protyle-preview>.b3-typography h1{
font-size: 24px !important;

.protyle-preview>.b3-typography h1 {
font-size: 24px !important;
}

[data-theme-mode="light"] .protyle-preview>.b3-typography h2 {
/* display: table;
text-align: center; */
border-bottom: 1px solid #dfe0e1 !important;
color: #083256;
color: #083256;
border-radius: 0px;
line-height: 1.75;
font-size: 20px !important;
Expand All @@ -41,6 +41,7 @@
text-align: center; */
/* margin: 20px auto 20px; */
}

[data-theme-mode="light"] .protyle-preview>.b3-typography h3,
#preview .protyle-wysiwyg .h3 {

Expand All @@ -51,32 +52,38 @@
border-left: 4px solid rgba(15, 76, 129, 1);
color: rgba(15, 76, 129, 1) !important;
}
[data-theme-mode="light"] .protyle-preview>.b3-typography h3{
font-size: 16px !important;

[data-theme-mode="light"] .protyle-preview>.b3-typography h3 {
font-size: 16px !important;
}

[data-theme-mode="light"] .protyle-preview .b3-typography h4,
[data-theme-mode="light"] .protyle-preview .b3-typography h4,
#preview .protyle-wysiwyg .h4 {
font-weight: bold;
color: #1c849e;
}
[data-theme-mode="light"] .protyle-preview .b3-typography h4{

[data-theme-mode="light"] .protyle-preview .b3-typography h4 {
font-size: 15px !important;
}

[data-theme-mode="light"] .protyle-preview>.b3-typography h5,
#preview .protyle-wysiwyg .h5 {
font-weight: bold;
color: rgba(15, 76, 129, 1);
}
[data-theme-mode="light"] .protyle-preview>.b3-typography h5{

[data-theme-mode="light"] .protyle-preview>.b3-typography h5 {
font-size: 14px !important;
}

[data-theme-mode="light"] .protyle-preview>.b3-typography h6,
#preview .protyle-wysiwyg .h6{
#preview .protyle-wysiwyg .h6 {
font-size: 14px !important;
font-weight: bold;
}
[data-theme-mode="light"] .protyle-preview>.b3-typography h6{

[data-theme-mode="light"] .protyle-preview>.b3-typography h6 {
font-size: 14px !important;
}

Expand All @@ -88,116 +95,134 @@
} */
/* 图片居中 */
#preview .protyle-wysiwyg .p:has(span.img),
[data-theme-mode="light"] .protyle-preview>.b3-typography p:has(span.img:only-child) {
text-align:center;
[data-theme-mode="light"] .protyle-preview>.b3-typography p:has(span.img:only-child) {
text-align: center;
}

/* 超链接 */
[data-theme-mode="light"] .protyle-preview>.b3-typography a {
color: #338dd6;
/* text-decoration: underline; */

}

/* 预览模式不显示超链接link icon */
[data-theme-mode="light"] .protyle-preview>.b3-typography a::before{
[data-theme-mode="light"] .protyle-preview>.b3-typography a::before {
display: none;
}

/* 行内代码 */
[data-theme-mode="light"] .protyle-preview>.b3-typography span[data-type~='code']{
color:#3779b3;
background-color:#f3f4f4;
[data-theme-mode="light"] .protyle-preview>.b3-typography span[data-type~='code'] {
color: #3779b3;
background-color: #f3f4f4;
}

/* 代码块 */
[data-theme-mode="light"] .protyle-preview>.b3-typography .hljs {
background-color: #f8f9fa;
}

/* 表格框线 */
[data-theme-mode="light"] .protyle-preview>.b3-typography table tr th,
[data-theme-mode="light"] .protyle-preview>.b3-typography table tr td{
[data-theme-mode="light"] .protyle-preview>.b3-typography table tr td {
border-color: #d1d3d6;
}

/* 引述块 */
.protyle-preview>.b3-typography blockquote,
#preview.protyle-wysiwyg blockquote{
#preview.protyle-wysiwyg blockquote {
padding: 2px 4px;
background-color: #F0F4F9;
border: 1px solid #e8e8e8;
color: rgb(13, 60, 97);
border-radius: 7px !important;
}

.protyle-preview>.b3-typography blockquote>blockquote {
border: none;
border-left: 0.3em solid #2183ce;
border-radius: 0px !important;
background: transparent !important;
}

.protyle-preview .b3-typography blockquote[style*='background-color'] {
border: 1px solid #e8e8e8 !important;
border-radius: 7px !important;
}

.protyle-preview .b3-typography blockquote .code-block{
.protyle-preview .b3-typography blockquote .code-block {
background-color: #f6f8fa66 !important;
box-shadow: 0 0 0 1px #1e25351a;
}
.protyle-preview .b3-typography blockquote .hljs{

.protyle-preview .b3-typography blockquote .hljs {
background-color: transparent !important;
}
.protyle-preview .b3-typography blockquote[style*='background-color: var(--b3-card-warning-background);']{
background-color: #fce4d2;
color: rgb(102, 60, 0);

.protyle-preview .b3-typography blockquote[style*='background-color: var(--b3-card-warning-background);'] {
background-color: #fce4d2;
color: rgb(102, 60, 0);
}

/* .protyle-preview .b3-typography blockquote[style*='background-color:']{
background-color: #fce4d2 !important;
color: rgb(102, 60, 0) !important;
}
.protyle-preview .b3-typography blockquote[style*='background-color'] span[data-type~=strong]{
color: rgb(102, 60, 0) ;
} */
.b3-typography>p{
border-radius: 6px;
}
/* 加粗 */
.b3-typography strong,
.b3-typography span[data-type~=strong],
.protyle-wysiwyg strong,
.protyle-wysiwyg span[data-type~=strong] {
font-weight: bold;
color: inherit;
}
/* 高亮 */
.b3-typography mark,
.b3-typography span[data-type~=mark] {
background-color: none;
box-shadow: none;
border-bottom: 2px solid #37be35;
color: #000;
}
.b3-typography code:not(.hljs),
.b3-typography span[data-type~=code]{
border-radius: 6px;
}
.b3-typography>p {
border-radius: 6px;
}

/* 加粗 */
.b3-typography strong,
.b3-typography span[data-type~=strong],
.protyle-wysiwyg strong,
.protyle-wysiwyg span[data-type~=strong] {
font-weight: bold;
color: inherit;
}

/* 高亮 */
.b3-typography mark,
.b3-typography span[data-type~=mark] {
background-color: initial;
box-shadow: none;
border-bottom: 2px solid #37be35;
color: #000;
}

.b3-typography code:not(.hljs),
.b3-typography span[data-type~=code] {
border-radius: 6px;
}

/* 分割线 */
.b3-typography hr {
border: 0;
border-bottom: 1px solid #d1d3d6;
margin: 21px 213px;
}

/* 表格 */
.b3-typography table {
border-collapse: collapse;
font-size: 14px !important;
margin: 1em auto;
}
.b3-typography table thead{

.b3-typography table thead {
background: rgba(0, 0, 0, 0.05);
}
.b3-typography table tr th{
border: 1px solid #eceded;

.b3-typography table tr th {
border: 1px solid #eceded;
}

.b3-typography table td,
.b3-typography table th{
font-size: 13px !important;
.b3-typography table th {
font-size: 13px !important;
}


Expand All @@ -211,21 +236,23 @@ border-radius: 6px;
font-family: var(--b3-font-family);
}
}



/* 去除导出pdf的列表竖线 */
#preview .protyle-wysiwyg [data-node-id].li:before {
border-left: 0.5px solid transparent;
}

/* pdf的a标签 */
#preview .protyle-wysiwyg a {
color: var(--b3-protyle-inline-link-color);
text-decoration: none;
border-bottom: 1px solid var(--custom-link-bottom-color);
}

/* pdf 导出块引链接文字为绿色,使用虚线下划线 */
#preview .protyle-wysiwyg [data-node-id] a[href^="siyuan://"]{
#preview .protyle-wysiwyg [data-node-id] a[href^="siyuan://"] {
color: var(--b3-protyle-inline-blockref-color);
border-bottom: 1px dashed var(--b3-protyle-inline-blockref-color);
}
Expand All @@ -237,27 +264,31 @@ border-radius: 6px;
/* box-shadow: none; */
}

#preview .protyle-wysiwyg .code-block .protyle-action .protyle-action__copy{
#preview .protyle-wysiwyg .code-block .protyle-action .protyle-action__copy {
display: none;
}

/* 表格居中 */
#preview .protyle-wysiwyg .table{
margin:auto;
#preview .protyle-wysiwyg .table {
margin: auto;
}

/* ---------------------------------------导出图片-----------------------------------*/
/* 行内代码优化 */
.export-img .protyle-wysiwyg span[data-type~='code']{
.export-img .protyle-wysiwyg span[data-type~='code'] {
margin-left: 0px;
margin-right: 0px;
}
.export-img .protyle-wysiwyg span[data-type~='code']:first-child{

.export-img .protyle-wysiwyg span[data-type~='code']:first-child {
margin-left: 0.4em;
}
.export-img .protyle-wysiwyg span[data-type~='code']:last-child{

.export-img .protyle-wysiwyg span[data-type~='code']:last-child {

margin-right: 0.4em;
}

/* 超链接样式 */
.export-img .protyle-wysiwyg a {
color: var(--b3-protyle-inline-link-color);
Expand Down

0 comments on commit 6b1748c

Please sign in to comment.