Skip to content

Commit

Permalink
🔖 v2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Achuan-2 committed May 10, 2024
1 parent fda55ab commit a8aed2c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 71 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v2.1.2 / 2024.05.10
- 🔥 取消代码块限制最大高度

## v2.1.1 / 2024.05.10
- ✨ 代码块限制最大高度优化:复制按钮不跟随滚动条滚动
- ✨ 代码块预览pdf界面不显示复制按钮
Expand Down
3 changes: 3 additions & 0 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

## 🚀最近更新

v2.1.2 / 2024.05.10
- 🔥 取消代码块限制最大高度

v2.1.1 / 2024.05.10
- ✨ 代码块限制最大高度优化:复制按钮不跟随滚动条滚动
- ✨ 代码块预览pdf界面不显示复制按钮
Expand Down
70 changes: 0 additions & 70 deletions style/module/code_block.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,73 +172,3 @@




/* ---------------------------代码块限制最大高度------------------------------*/
/* 限制代码块高度,设置超过高度,出现滚动条 */
.protyle-wysiwyg .code-block {
max-height: 800px;
overflow: auto;

}

/* 防止因代码行号和代码渲染内容导致出现多重滚动条 */
.protyle-wysiwyg .hljs,
.protyle-linenumber__rows {
height: max-content;
}

/* 调整代码块命名、别名等块属性位置 */
.protyle-wysiwyg .code-block .protyle-attr {
top: -2px;
}

/* 代码块功能按钮:包括代码语言、复制和菜单按钮 */
.protyle-wysiwyg .code-block .protyle-action {
/* 为了代码块复制按钮可以sticky,需要设置高度 */
height: 100%;
/* 取消top高度,否则会出现代码块会被撑开出现滚动条 */
top: 0px !important;
/* 需要禁止鼠标点击,否则浮在上面代码块上无法点击 */
pointer-events: none !important;
}

/* 代码块语言 */
.protyle-wysiwyg .code-block .protyle-action .protyle-action__language {
margin-top: 6px;
position: absolute;
top: 6px;
position: sticky;
/* 由于父元素禁止点击,所以要子元素允许点击 */
pointer-events: all !important;
align-self: flex-start;
}

/* 代码块复制和菜单按钮 */
.protyle-wysiwyg .code-block .protyle-action .b3-tooltips__nw {
/* 调整位置 */
top: 17px;
/* 代码块复制按钮sticky,不跟随滚动 */
position: sticky;
/* 由于父元素禁止点击,所以要子元素允许点击 */
pointer-events: all !important;
}

/* 代码块复制按钮和菜单按钮的提示文字放在下方 */
.protyle-wysiwyg .code-block .protyle-action .b3-tooltips__nw::after {
top: 100%;
bottom: inherit;
margin-top: 5px;
}

.protyle-wysiwyg .code-block .protyle-action .b3-tooltips__nw::before {
top: 100%;
bottom: inherit;
rotate: 180deg;
margin-top: -4px;
}

/* 导出pdf取消限制最大高度 */
#preview .protyle-wysiwyg .code-block {
max-height: none;
}
/* ---------------------------代码块限制最大高度------------------------------*/
2 changes: 1 addition & 1 deletion theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Tsundoku",
"author": "Achuan-2",
"url": "https://github.com/Achuan-2/siyuan-themes-tsundoku",
"version": "2.1.0",
"version": "2.1.2",
"displayName": {
"default": "Tsundoku",
"zh_CN": "積読"
Expand Down

0 comments on commit a8aed2c

Please sign in to comment.