Skip to content

Commit

Permalink
fix: fix or revise hyperlink style in editor and output PDF
Browse files Browse the repository at this point in the history
Former-commit-id: 42f4de8
  • Loading branch information
Keldos-Li committed Jan 17, 2022
1 parent b3c57c6 commit 99defa1
Showing 1 changed file with 35 additions and 17 deletions.
52 changes: 35 additions & 17 deletions src/latex-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@
/* 目录中是否显示一级标题 */
--toc-show-title: none;

/* == 颜色设置 == */
/* 超链接颜色 */
--link-color-light: #2E67D3;
--link-color-dark: #8bb1f9;

@if $theme == "dark" {
--md-char-color: hsl(212, 100%, 85%);
--link-hover: hsl(212, 100%, 85%);
Expand All @@ -168,15 +173,28 @@
}
}

/* ========== VERY IMPORTANT 请注意看下面的几行: ================
如果您需要在输出PDF时隐藏超链接的颜色和下划线,请取消注释下面的代码块,即删去下面的 Ln.1 和 Ln.2
如果您需要在输出PDF时保持超链接的显示效果,则不用更改 ============= */
/* 如要取消注释代码,请把本行删去 Ln.1
@media print {
#write a {
color: inherit !important;
text-decoration: none;
}
}
如要取消注释代码,请把本行删去 Ln.2 */
// 因为 CSS 没有一般的布尔变量可以使用,所以采用这种笨办法,如果有其他开关方法可以选用请 pull request, 谢谢

body {
padding: 0 !important;
margin: 0 !important;
line-height: var(--base-line-height);
/*counter-reset: tableHead 0 imgHead 0;*/
/* counter-reset: tableHead 0 imgHead 0; */
@if $theme == "dark" {
/* 黑色模式修改 */
color: #dddddd;
/* 黑色模式修改 */
background-color: #282828;
// background:url(mermaidAPI.initialize({'fontFamily': '宋体-简, serif;'}););
}
Expand All @@ -191,11 +209,11 @@ strong {
padding: var(--set-margin);
@if $theme == "light" {
/* 添加一个淡蓝色的边框 */
/*border: 0.8px solid #AAC ; */
/* border: 0.8px solid #AAC ; */
/* 页边阴影 */
box-shadow: 0 0 24px 12px #cccccc;
} @else if $theme == "dark" {
/*border: 1px solid #AAAAAA ;*/
/* border: 1px solid #AAAAAA ;*/
/* 页边阴影 */
box-shadow: 0 0 24px 12px #101010;
}
Expand All @@ -206,10 +224,6 @@ strong {
#write {
padding: 0 !important;
}
#write a {
color: inherit;
text-decoration: none;
}
@page {
margin: 1.8cm 2cm 1.2cm 2cm !important; /* 页边距 */
}
Expand All @@ -234,7 +248,6 @@ strong {
@if $theme == "light" {
background-color: white;
} @else if $theme == "dark" {
/* 黑色模式修改 */
background-color: #1e1e1e;
}
/* column-count: 2;
Expand All @@ -247,6 +260,17 @@ strong {
text-align: left;
}

// 超链接
@if $theme == "light" {
a {
color: var(--link-color-light);
}
} @else if $theme == "dark" {
a {
color: var(--link-color-dark);
}
}

// 标题属性
h1,
h2,
Expand Down Expand Up @@ -782,8 +806,7 @@ h6.md-focus:before {
@if $theme == "dark" {
/* Modifications for dark-mode */

/* ====================我加的================== */
/*
/* 可能的代码高亮样式
.cm-s-inner {
background-color: #263238;
color: rgba(233, 237, 237);
Expand Down Expand Up @@ -996,11 +1019,6 @@ h6.md-focus:before {
animation: none;
}

/* 更改URL超链接颜色,最初的颜色不易查看 */
span > a {
color: #8bb1f9;
}

/* quick open框 (e.g. 插入代码后弹出的语言候选框) */
.auto-suggest-container {
border: 0px;
Expand Down

0 comments on commit 99defa1

Please sign in to comment.