Skip to content

Improve the line-height of the title blocks in the list - #15375

Merged
Vanessa219 merged 2 commits into
siyuan-note:devfrom
TCOTC:fix/15003
Aug 1, 2025
Merged

Improve the line-height of the title blocks in the list#15375
Vanessa219 merged 2 commits into
siyuan-note:devfrom
TCOTC:fix/15003

Conversation

@TCOTC

@TCOTC TCOTC commented Jul 27, 2025

Copy link
Copy Markdown
Contributor

Fix #15003

@emptylight370

Copy link
Copy Markdown
Contributor

这个pr修复之后标题的行高表现和原先旧版本一样吗(导致标题向上偏移的修改前)

@TCOTC

TCOTC commented Jul 27, 2025

Copy link
Copy Markdown
Contributor Author

不知道,你可以试试:

.protyle-wysiwyg [data-node-id].li>.protyle-action~[data-type=NodeHeading] {
    line-height: calc(var(--b3-font-size-editor) * 1.625);
}

@emptylight370

This comment was marked as resolved.

@TCOTC

This comment was marked as outdated.

@emptylight370

This comment was marked as off-topic.

@TCOTC

TCOTC commented Jul 27, 2025

Copy link
Copy Markdown
Contributor Author

我管理起来方便,PR 和 issue 有一个开着就行

另外就是这里合并之后没法连带关闭 issue,不知道为什么

@emptylight370

This comment was marked as off-topic.

@TCOTC

TCOTC commented Jul 27, 2025

Copy link
Copy Markdown
Contributor Author

以后有机会再试试

@Vanessa219

Copy link
Copy Markdown
Member

--b3-font-size-editor 无法适配列表设置字体大小的情况。
image

@TCOTC

TCOTC commented Jul 31, 2025

Copy link
Copy Markdown
Contributor Author

改了一下

@Vanessa219
Vanessa219 merged commit 857a795 into siyuan-note:dev Aug 1, 2025
@Vanessa219
Vanessa219 requested review from Vanessa219 and Copilot and removed request for Vanessa219 August 1, 2025 09:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the line-height styling for heading blocks within lists by replacing a single fixed line-height value with specific calculations for each heading level (h1-h6). The change addresses visual spacing issues in list items containing headings.

  • Replaces fixed line-height: 1em with level-specific calculations
  • Provides proportional line-height values that scale with heading importance
  • Maintains consistent visual hierarchy within list contexts

Comment on lines +187 to +203
line-height: calc(1.625em / 1.75);
}

&.h2 {
line-height: calc(1.625em / 1.55);
}

&.h3 {
line-height: calc(1.625em / 1.38);
}

&.h4 {
line-height: calc(1.625em / 1.25);
}

&.h5 {
line-height: calc(1.625em / 1.13);

Copilot AI Aug 1, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic numbers (1.75, 1.55, 1.38, 1.25, 1.13) used in the line-height calculations lack explanation. Consider adding a comment explaining the rationale behind these divisors or defining them as CSS custom properties for better maintainability.

Suggested change
line-height: calc(1.625em / 1.75);
}
&.h2 {
line-height: calc(1.625em / 1.55);
}
&.h3 {
line-height: calc(1.625em / 1.38);
}
&.h4 {
line-height: calc(1.625em / 1.25);
}
&.h5 {
line-height: calc(1.625em / 1.13);
line-height: calc(1.625em / var(--line-height-h1));
}
&.h2 {
line-height: calc(1.625em / var(--line-height-h2));
}
&.h3 {
line-height: calc(1.625em / var(--line-height-h3));
}
&.h4 {
line-height: calc(1.625em / var(--line-height-h4));
}
&.h5 {
line-height: calc(1.625em / var(--line-height-h5));

Copilot uses AI. Check for mistakes.
@TCOTC
TCOTC deleted the fix/15003 branch August 1, 2025 09:57
boyiwan pushed a commit to boyiwan/siyuan that referenced this pull request Sep 10, 2025
…15375)

* 💄 Improve the line-height of the title blocks in the list

fix siyuan-note#15003

* 💄 Improve the line-height of the title blocks in the list

fix siyuan-note#15003
leolee9086 pushed a commit to leolee9086/siyuan that referenced this pull request Oct 25, 2025
…15375)

* 💄 Improve the line-height of the title blocks in the list

fix siyuan-note#15003

* 💄 Improve the line-height of the title blocks in the list

fix siyuan-note#15003
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants