latex-stickies 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/renderer/live-editor.js +17 -0
- package/src/renderer/note.css +28 -3
package/package.json
CHANGED
|
@@ -447,6 +447,23 @@ function buildDecorations(state) {
|
|
|
447
447
|
const first = state.doc.lineAt(node.from).number;
|
|
448
448
|
const last = state.doc.lineAt(node.to).number;
|
|
449
449
|
for (let n = first; n <= last; n++) addLine(state.doc.line(n).from, cls);
|
|
450
|
+
|
|
451
|
+
// A quote inside a quote is a quote inside a quote, and drawing every
|
|
452
|
+
// level the same made ">" and ">>" identical on screen. The outer
|
|
453
|
+
// node is entered first, so the deeper class lands only on the lines
|
|
454
|
+
// that are actually deeper. Capped because past three the indent eats
|
|
455
|
+
// the width of a sticky note.
|
|
456
|
+
if (node.name === 'Blockquote') {
|
|
457
|
+
let depth = 0;
|
|
458
|
+
for (let up = node.node; up; up = up.parent) {
|
|
459
|
+
if (up.name === 'Blockquote') depth += 1;
|
|
460
|
+
}
|
|
461
|
+
if (depth > 1) {
|
|
462
|
+
const level = `cm-md-quote-${Math.min(depth, 3)}`;
|
|
463
|
+
for (let n = first; n <= last; n++) addLine(state.doc.line(n).from, level);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
450
467
|
if (node.name === 'FencedCode') {
|
|
451
468
|
addLine(state.doc.line(first).from, 'cm-md-code-first');
|
|
452
469
|
addLine(state.doc.line(last).from, 'cm-md-code-last');
|
package/src/renderer/note.css
CHANGED
|
@@ -154,11 +154,36 @@ body.editing #tools > * { visibility: visible; }
|
|
|
154
154
|
.cm-md-h3 { font-size: 1.05em; font-weight: 600; }
|
|
155
155
|
.cm-md-h4, .cm-md-h5, .cm-md-h6 { font-weight: 600; }
|
|
156
156
|
|
|
157
|
-
.cm-
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
/* Scoped to .cm-editor because `.cm-editor .cm-line { padding: 0 }` above
|
|
158
|
+
zeroes it, and a bare .cm-md-quote loses to that -- which is why quoted
|
|
159
|
+
text sat hard against its own bar with no inset at all. The padding also
|
|
160
|
+
gives a wrapped quote its hanging indent, for nothing. */
|
|
161
|
+
.cm-editor .cm-md-quote {
|
|
162
|
+
--quote-depth: 1;
|
|
163
|
+
position: relative;
|
|
164
|
+
padding-left: calc(var(--quote-depth) * 0.9em + 0.4em);
|
|
160
165
|
opacity: 0.85;
|
|
161
166
|
}
|
|
167
|
+
.cm-editor .cm-md-quote-2 { --quote-depth: 2; }
|
|
168
|
+
.cm-editor .cm-md-quote-3 { --quote-depth: 3; }
|
|
169
|
+
|
|
170
|
+
/* One bar per nesting level, drawn as a repeating gradient rather than a
|
|
171
|
+
border: a line has only one border-left however deep the quote is. The
|
|
172
|
+
gradient repeats on the same interval as the indent, so it draws exactly
|
|
173
|
+
as many bars as there are levels. */
|
|
174
|
+
.cm-editor .cm-md-quote::before {
|
|
175
|
+
content: '';
|
|
176
|
+
position: absolute;
|
|
177
|
+
left: 0;
|
|
178
|
+
top: 0;
|
|
179
|
+
bottom: 0;
|
|
180
|
+
width: calc(var(--quote-depth) * 0.9em);
|
|
181
|
+
background: repeating-linear-gradient(
|
|
182
|
+
to right,
|
|
183
|
+
rgba(0, 0, 0, 0.22) 0 2px,
|
|
184
|
+
transparent 2px 0.9em
|
|
185
|
+
);
|
|
186
|
+
}
|
|
162
187
|
|
|
163
188
|
/* Smaller text, but the same line box as prose. CodeMirror moves the caret
|
|
164
189
|
vertically by one default line height, so a line shorter than that gets
|