Skip to content

Improve setInlineStyle #15193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

TCOTC
Copy link
Contributor

@TCOTC TCOTC commented Jul 1, 2025

No description provided.

@88250
Copy link
Member

88250 commented Aug 2, 2025

麻烦描述一下改动

color: var(--b3-theme-on-surface-light);
height: calc(var(--b3-font-size-editor) * 1.625);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

height 改为通过已有的 --b3-font-size-editor 计算,用 CSS 替代 JS

@@ -170,7 +170,6 @@ export const initAssets = () => {
};

export const setInlineStyle = async (set = true) => {
const height = Math.floor(window.siyuan.config.editor.fontSize * 1.625);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

height 改为通过已有的 --b3-font-size-editor 计算,用 CSS 替代 JS

if (isWin11Browser) {
style = `@font-face {
} else if (await isWin11()) {
// Win11 Browser
Copy link
Contributor Author

Choose a reason for hiding this comment

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

修改多余的分支逻辑

if (window.siyuan.config.editor.rtl) {
rtlCSS = `.protyle-title__input,
style += `
.protyle-title__input,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

去除 rtlCSS 变量,直接修改 style 变量

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants