Skip to content

Commit 7f1db1f

Browse files
committed
🎨 #13564
1 parent d9d4827 commit 7f1db1f

File tree

3 files changed

+25
-48
lines changed

3 files changed

+25
-48
lines changed

app/src/assets/scss/component/_typography.scss

+12-20
Original file line numberDiff line numberDiff line change
@@ -153,38 +153,31 @@
153153
h5,
154154
h6 {
155155
padding: 4px;
156-
margin: 4px 0;
157-
font-weight: 600;
158-
line-height: 1.25;
156+
margin: 2px 0;
159157
}
160158

161159
.h1,
162160
.h2,
163161
.h3,
164162
.h4,
165163
.h5,
166-
.h6 {
164+
.h6,
165+
h1,
166+
h2,
167+
h3,
168+
h4,
169+
h5,
170+
h6 {
167171
font-weight: 600;
168-
169-
&[data-node-id] [spellcheck] {
170-
min-height: 1.625em;
171-
}
172-
}
173-
174-
h1 {
175-
padding: .3em 4px;
176-
font-size: 1.75em;
172+
line-height: 1.25;
177173
}
178174

175+
h1,
179176
.h1 {
180177
font-size: 1.75em;
181178
}
182179

183-
h2 {
184-
padding: .3em 4px;
185-
font-size: 1.55em;
186-
}
187-
180+
h2,
188181
.h2 {
189182
font-size: 1.55em;
190183
}
@@ -318,8 +311,7 @@
318311
}
319312

320313
.protyle-action__language {
321-
position: absolute;
322-
left: 1em;
314+
margin-left: 1em;
323315
opacity: 0;
324316
transition: var(--b3-transition);
325317
}

app/src/assets/scss/protyle/_wysiwyg.scss

+12-26
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@
166166
align-items: center;
167167
word-break: keep-all;
168168

169+
// https://github.com/siyuan-note/siyuan/issues/2803
170+
& ~ .h1,
171+
& ~ .h2,
172+
& ~ .h3,
173+
& ~ .h4,
174+
& ~ .h5,
175+
& ~ .h6 {
176+
padding-top: 0;
177+
padding-bottom: 0;
178+
}
179+
169180
&::after {
170181
content: "";
171182
position: absolute;
@@ -185,17 +196,6 @@
185196
&--order::after {
186197
border-radius: var(--b3-border-radius);
187198
}
188-
189-
~ .h1,
190-
~ .h2,
191-
~ .h3,
192-
~ .h4,
193-
~ .h5,
194-
~ .h6 {
195-
[spellcheck] {
196-
min-height: unset;
197-
}
198-
}
199199
}
200200
}
201201

@@ -231,20 +231,6 @@
231231
position: initial;
232232
margin-left: 4px;
233233
}
234-
235-
/* 选中块的高亮覆盖 margin */
236-
&> .protyle-wysiwyg--select:not(.sb)::after,
237-
&> .protyle-wysiwyg--hl:not(.sb)::after{
238-
height: calc(100% + 4px);
239-
top: -2px;
240-
}
241-
242-
/* 选中块的高亮覆盖 border 和 margin */
243-
&> .protyle-wysiwyg--select.render-node[data-type="NodeBlockQueryEmbed"]::after,
244-
&> .protyle-wysiwyg--hl.render-node[data-type="NodeBlockQueryEmbed"]::after{
245-
height: calc(100% + 6px);
246-
top: -3px;
247-
}
248234
}
249235
}
250236

@@ -326,7 +312,7 @@
326312

327313
/* 选中块的高亮覆盖 border */
328314
&.protyle-wysiwyg--select::after,
329-
&.protyle-wysiwyg--hl::after{
315+
&.protyle-wysiwyg--hl::after {
330316
width: calc(100% + 2px);
331317
height: calc(100% + 2px);
332318
left: -1px;

app/src/util/assets.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,7 @@ export const setInlineStyle = async (set = true) => {
288288
}`;
289289
}
290290
}
291-
style += `\n:root{--b3-font-size-editor:${window.siyuan.config.editor.fontSize}px}
292-
.b3-typography, .protyle-wysiwyg, .protyle-title {font-size:${window.siyuan.config.editor.fontSize}px !important}
291+
style += `.b3-typography, .protyle-wysiwyg, .protyle-title {font-size:${window.siyuan.config.editor.fontSize}px !important}
293292
.b3-typography code:not(.hljs), .protyle-wysiwyg span[data-type~=code] { font-variant-ligatures: ${window.siyuan.config.editor.codeLigatures ? "normal" : "none"} }
294293
.li > .protyle-action {height:${height + 8}px;line-height: ${height + 8}px}
295294
.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;}

0 commit comments

Comments
 (0)