Improve the line-height of the title blocks in the list - #15375
Merged
Conversation
Contributor
|
这个pr修复之后标题的行高表现和原先旧版本一样吗(导致标题向上偏移的修改前) |
Contributor
Author
|
不知道,你可以试试: .protyle-wysiwyg [data-node-id].li>.protyle-action~[data-type=NodeHeading] {
line-height: calc(var(--b3-font-size-editor) * 1.625);
} |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
Contributor
Author
|
我管理起来方便,PR 和 issue 有一个开着就行 另外就是这里合并之后没法连带关闭 issue,不知道为什么 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Contributor
Author
|
以后有机会再试试 |
8 tasks
Member
Contributor
Author
|
改了一下 |
Vanessa219
requested review from
Vanessa219 and
Copilot
and removed request for
Vanessa219
August 1, 2025 09:53
Contributor
There was a problem hiding this comment.
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: 1emwith 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); |
There was a problem hiding this comment.
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)); |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fix #15003