Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Block icons support quickly inserting blocks above or below https://github.com/siyuan-note/siyuan/issues/17900

Daniel1a8a2935b5b0
diff --git a/app/src/assets/scss/protyle/_protyle.scss b/app/src/assets/scss/protyle/_protyle.scss
index 1f36987b47..6d76cb48a8 100644
--- a/app/src/assets/scss/protyle/_protyle.scss
+++ b/app/src/assets/scss/protyle/_protyle.scss
@@ -90,8 +90,7 @@
color: var(--b3-theme-on-surface);
}
- // 悬浮时显示固定尺寸的圆角背景(排除框线与+号,它们有自己的样式)
- // 用 ::before 而非直接设 button 背景,避免受 padding/svg 尺寸影响导致宽高不一致
+ // 悬浮时显示正方形圆角背景(排除框线与+号,它们有自己的样式),居中于块标 button
&:not(.protyle-gutters__line):not(.protyle-gutters__plus)::before {
content: '';
position: absolute;
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index dec1343e48..0fa72dcb17 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -650,13 +650,13 @@ export class Gutter {
lineBefore.style.opacity = "1";
lineBefore.style.width = "2px";
lineBefore.style.height = `${lineH}px`;
- lineBefore.style.left = `${rect.left}px`;
+ lineBefore.style.left = `${rect.left - 4}px`;
lineBefore.style.top = `${top}px`;
lineAfter.style.display = "";
lineAfter.style.opacity = "1";
lineAfter.style.width = "2px";
lineAfter.style.height = `${lineH}px`;
- lineAfter.style.left = `${rect.right - 2}px`;
+ lineAfter.style.left = `${rect.right + 2}px`;
lineAfter.style.top = `${top}px`;
plusBefore.style.width = `${plusSize}px`;
plusBefore.style.height = `${plusSize}px`;
@@ -679,13 +679,13 @@ export class Gutter {
lineBefore.style.width = `${lineW}px`;
lineBefore.style.height = "2px";
lineBefore.style.left = `${left}px`;
- lineBefore.style.top = `${rect.top}px`;
+ lineBefore.style.top = `${rect.top - 4}px`;
lineAfter.style.display = "";
lineAfter.style.opacity = "1";
lineAfter.style.width = `${lineW}px`;
lineAfter.style.height = "2px";
lineAfter.style.left = `${left}px`;
- lineAfter.style.top = `${rect.bottom - 2}px`;
+ lineAfter.style.top = `${rect.bottom + 2}px`;
plusBefore.style.width = `${plusSize}px`;
plusBefore.style.height = `${plusSize}px`;
plusBefore.style.left = `${plusLeft}px`;