Non jumpy headers
parent
bbe4c77bd4
commit
ad596d4a65
|
@ -150,6 +150,7 @@ const typesWithMarks = [
|
||||||
"Emphasis",
|
"Emphasis",
|
||||||
"StrongEmphasis",
|
"StrongEmphasis",
|
||||||
"InlineCode",
|
"InlineCode",
|
||||||
|
"Highlight",
|
||||||
"Strikethrough",
|
"Strikethrough",
|
||||||
"WikiLink",
|
"WikiLink",
|
||||||
"CommandLink",
|
"CommandLink",
|
||||||
|
@ -160,6 +161,7 @@ const typesWithMarks = [
|
||||||
const markTypes = [
|
const markTypes = [
|
||||||
"EmphasisMark",
|
"EmphasisMark",
|
||||||
"CodeMark",
|
"CodeMark",
|
||||||
|
"HighlightMark",
|
||||||
"StrikethroughMark",
|
"StrikethroughMark",
|
||||||
"WikiLinkMark",
|
"WikiLinkMark",
|
||||||
"CommandLinkMark",
|
"CommandLinkMark",
|
||||||
|
@ -255,7 +257,12 @@ class HideHeaderMarkPlugin {
|
||||||
const cursorOverlaps = ranges.some(({ from, to }) =>
|
const cursorOverlaps = ranges.some(({ from, to }) =>
|
||||||
checkRangeOverlap([from, to], [line.from, line.to])
|
checkRangeOverlap([from, to], [line.from, line.to])
|
||||||
);
|
);
|
||||||
if (cursorOverlaps) return;
|
if (cursorOverlaps) {
|
||||||
|
widgets.push(
|
||||||
|
Decoration.line({ class: "sb-header-inside" }).range(from),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
type.name === "HeaderMark" &&
|
type.name === "HeaderMark" &&
|
||||||
// Setext heading's horizontal lines are not hidden.
|
// Setext heading's horizontal lines are not hidden.
|
||||||
|
|
|
@ -110,10 +110,6 @@
|
||||||
content: "\2022"; /* U+2022 BULLET */
|
content: "\2022"; /* U+2022 BULLET */
|
||||||
}
|
}
|
||||||
|
|
||||||
// .sb-directive-start {
|
|
||||||
// border-bottom: 1px dotted #6c6c6c;
|
|
||||||
// }
|
|
||||||
|
|
||||||
.sb-directive-start .sb-comment, .sb-directive-end .sb-comment {
|
.sb-directive-start .sb-comment, .sb-directive-end .sb-comment {
|
||||||
position: relative;
|
position: relative;
|
||||||
left: -12px;
|
left: -12px;
|
||||||
|
|
|
@ -128,11 +128,23 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sb-header-inside.sb-line-h1 {
|
||||||
|
margin-left: -2ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sb-header-inside.sb-line-h2 {
|
||||||
|
margin-left: -3ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sb-header-inside.sb-line-h3 {
|
||||||
|
margin-left: -4ch;
|
||||||
|
}
|
||||||
|
|
||||||
.sb-line-h1,
|
.sb-line-h1,
|
||||||
.sb-line-h2,
|
.sb-line-h2,
|
||||||
.sb-line-h3 {
|
.sb-line-h3 {
|
||||||
background-color: rgba(0, 30, 77, 0.5);
|
// background-color: rgba(0, 30, 77, 0.5);
|
||||||
color: #fff;
|
color: #333;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 2px 2px !important;
|
padding: 2px 2px !important;
|
||||||
}
|
}
|
||||||
|
@ -140,7 +152,7 @@
|
||||||
.sb-line-h1 .sb-meta,
|
.sb-line-h1 .sb-meta,
|
||||||
.sb-line-h2 .sb-meta,
|
.sb-line-h2 .sb-meta,
|
||||||
.sb-line-h3 .sb-meta {
|
.sb-line-h3 .sb-meta {
|
||||||
color: orange;
|
color: #a1a1a0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sb-line-h1 {
|
.sb-line-h1 {
|
||||||
|
|
Loading…
Reference in New Issue