Skip to content

Commit

Permalink
🎨 #13564
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 29, 2025
1 parent d9d4827 commit 7f1db1f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 48 deletions.
32 changes: 12 additions & 20 deletions app/src/assets/scss/component/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,38 +153,31 @@
h5,
h6 {
padding: 4px;
margin: 4px 0;
font-weight: 600;
line-height: 1.25;
margin: 2px 0;
}

.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 600;

&[data-node-id] [spellcheck] {
min-height: 1.625em;
}
}

h1 {
padding: .3em 4px;
font-size: 1.75em;
line-height: 1.25;
}

h1,
.h1 {
font-size: 1.75em;
}

h2 {
padding: .3em 4px;
font-size: 1.55em;
}

h2,
.h2 {
font-size: 1.55em;
}
Expand Down Expand Up @@ -318,8 +311,7 @@
}

.protyle-action__language {
position: absolute;
left: 1em;
margin-left: 1em;
opacity: 0;
transition: var(--b3-transition);
}
Expand Down
38 changes: 12 additions & 26 deletions app/src/assets/scss/protyle/_wysiwyg.scss
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@
align-items: center;
word-break: keep-all;

// https://github.com/siyuan-note/siyuan/issues/2803
& ~ .h1,
& ~ .h2,
& ~ .h3,
& ~ .h4,
& ~ .h5,
& ~ .h6 {
padding-top: 0;
padding-bottom: 0;
}

&::after {
content: "";
position: absolute;
Expand All @@ -185,17 +196,6 @@
&--order::after {
border-radius: var(--b3-border-radius);
}

~ .h1,
~ .h2,
~ .h3,
~ .h4,
~ .h5,
~ .h6 {
[spellcheck] {
min-height: unset;
}
}
}
}

Expand Down Expand Up @@ -231,20 +231,6 @@
position: initial;
margin-left: 4px;
}

/* 选中块的高亮覆盖 margin */
&> .protyle-wysiwyg--select:not(.sb)::after,
&> .protyle-wysiwyg--hl:not(.sb)::after{
height: calc(100% + 4px);
top: -2px;
}

/* 选中块的高亮覆盖 border 和 margin */
&> .protyle-wysiwyg--select.render-node[data-type="NodeBlockQueryEmbed"]::after,
&> .protyle-wysiwyg--hl.render-node[data-type="NodeBlockQueryEmbed"]::after{
height: calc(100% + 6px);
top: -3px;
}
}
}

Expand Down Expand Up @@ -326,7 +312,7 @@

/* 选中块的高亮覆盖 border */
&.protyle-wysiwyg--select::after,
&.protyle-wysiwyg--hl::after{
&.protyle-wysiwyg--hl::after {
width: calc(100% + 2px);
height: calc(100% + 2px);
left: -1px;
Expand Down
3 changes: 1 addition & 2 deletions app/src/util/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ export const setInlineStyle = async (set = true) => {
}`;
}
}
style += `\n:root{--b3-font-size-editor:${window.siyuan.config.editor.fontSize}px}
.b3-typography, .protyle-wysiwyg, .protyle-title {font-size:${window.siyuan.config.editor.fontSize}px !important}
style += `.b3-typography, .protyle-wysiwyg, .protyle-title {font-size:${window.siyuan.config.editor.fontSize}px !important}
.b3-typography code:not(.hljs), .protyle-wysiwyg span[data-type~=code] { font-variant-ligatures: ${window.siyuan.config.editor.codeLigatures ? "normal" : "none"} }
.li > .protyle-action {height:${height + 8}px;line-height: ${height + 8}px}
.protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h1, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h2, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h3, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h4, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h5, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h6 {line-height:${height + 8}px;}
Expand Down

0 comments on commit 7f1db1f

Please sign in to comment.