@vscode/markdown-editor 0.0.2-69 → 0.0.2-70
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 +2 -2
- package/src/view/editor.css +52 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vscode/markdown-editor",
|
|
3
|
-
"version": "0.0.2-
|
|
3
|
+
"version": "0.0.2-70",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"vitest": "^4.1.0",
|
|
112
112
|
"zod": "^4.3.6"
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "1fc3f6d3213aba002772f2b36cde88fd23f89a42"
|
|
115
115
|
}
|
package/src/view/editor.css
CHANGED
|
@@ -152,7 +152,13 @@
|
|
|
152
152
|
.md-marker {
|
|
153
153
|
color: #999;
|
|
154
154
|
font-family: 'Cascadia Code', 'Fira Code', monospace;
|
|
155
|
-
|
|
155
|
+
/*
|
|
156
|
+
* Revealed source is painted a step smaller than body text. Published as a
|
|
157
|
+
* custom property because a gutter marker has to undo it to size its box
|
|
158
|
+
* against the body line box — see `.md-list-item-active>.md-marker-listItemMarker`.
|
|
159
|
+
*/
|
|
160
|
+
--md-marker-font-scale: 0.85;
|
|
161
|
+
font-size: calc(1em * var(--md-marker-font-scale));
|
|
156
162
|
display: inline;
|
|
157
163
|
overflow: hidden;
|
|
158
164
|
max-width: 100px;
|
|
@@ -691,29 +697,48 @@ pre.md-unhandled-scroll.md-code-block {
|
|
|
691
697
|
* before the marker. Gutter-positioning keeps the marker out of the inline
|
|
692
698
|
* flow so toggling it never shifts the item's text horizontally.
|
|
693
699
|
*
|
|
694
|
-
*
|
|
695
|
-
*
|
|
696
|
-
*
|
|
697
|
-
*
|
|
700
|
+
* Vertical centring makes the marker box exactly the item's first line box and
|
|
701
|
+
* centres the glyph in it. Getting that box right is the whole trick: an
|
|
702
|
+
* inherited UNITLESS line-height is re-resolved against the element's own
|
|
703
|
+
* font-size, so a marker shrunk by `--md-marker-font-scale` also gets a
|
|
704
|
+
* proportionally shorter line box which, pinned at `top: 0`, floats the glyph
|
|
705
|
+
* above the text. Dividing `1lh` by that same scale cancels the shrink exactly,
|
|
706
|
+
* without touching the painted size and without a `transform` (which would
|
|
707
|
+
* shrink the box the caret geometry is measured from).
|
|
698
708
|
*/
|
|
699
709
|
.md-list-item-active>.md-marker-listItemMarker {
|
|
700
710
|
position: absolute;
|
|
701
711
|
right: 100%;
|
|
702
712
|
top: 0;
|
|
703
713
|
line-height: inherit;
|
|
714
|
+
height: calc(1lh / var(--md-marker-font-scale));
|
|
715
|
+
display: inline-flex;
|
|
716
|
+
align-items: center;
|
|
717
|
+
justify-content: flex-end;
|
|
704
718
|
white-space: pre;
|
|
705
719
|
}
|
|
706
720
|
|
|
721
|
+
/*
|
|
722
|
+
* `display: inline-flex` above outranks the plain `.md-marker-hidden`
|
|
723
|
+
* (`display: none`), so — exactly as for headings — re-hide the marker here for
|
|
724
|
+
* the states that ask for it, otherwise the bullet could never be hidden.
|
|
725
|
+
*/
|
|
726
|
+
.md-list-item-active>.md-marker-listItemMarker.md-marker-hidden {
|
|
727
|
+
display: none;
|
|
728
|
+
}
|
|
729
|
+
|
|
707
730
|
/*
|
|
708
731
|
* An inactive ordered item uses the browser's native `::marker`. Match its
|
|
709
732
|
* typography when revealing the source marker so switching the active item
|
|
710
|
-
* does not change the number's width or horizontal position
|
|
711
|
-
*
|
|
733
|
+
* does not change the number's width or horizontal position: an ordered marker
|
|
734
|
+
* opts out of the muted size step entirely, which also makes the `1lh`
|
|
735
|
+
* compensation above a no-op for it. Keep unordered source markers in the
|
|
736
|
+
* standard muted monospace source style.
|
|
712
737
|
*/
|
|
713
738
|
ol.md-list>.md-list-item-active>.md-marker-listItemMarker,
|
|
714
739
|
ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker {
|
|
715
740
|
font-family: inherit;
|
|
716
|
-
font-
|
|
741
|
+
--md-marker-font-scale: 1;
|
|
717
742
|
}
|
|
718
743
|
|
|
719
744
|
/*
|
|
@@ -748,6 +773,25 @@ ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker {
|
|
|
748
773
|
flex: 0 0 auto;
|
|
749
774
|
}
|
|
750
775
|
|
|
776
|
+
/*
|
|
777
|
+
* A NESTED item's bullet is a flex child of the gutter, so the direct-child
|
|
778
|
+
* rule above cannot reach it and it would otherwise stretch to the gutter's
|
|
779
|
+
* full height with its glyph parked at the top. Centring is therefore done by
|
|
780
|
+
* the gutter itself: it is statically positioned (hence aligned to the item's
|
|
781
|
+
* first line), so making it one line box tall and centring its children puts
|
|
782
|
+
* the bullet and the indentation dots on that line.
|
|
783
|
+
*
|
|
784
|
+
* The gutter carries body typography, so its `1lh` needs no compensation — and
|
|
785
|
+
* the bullet inside keeps its own muted `font-size`, which is exactly what the
|
|
786
|
+
* shrink-to-fit gutter reserves. Shrinking the bullet visually instead would
|
|
787
|
+
* make the gutter reserve more width than the bullet paints and slide the whole
|
|
788
|
+
* indentation column left.
|
|
789
|
+
*/
|
|
790
|
+
.md-list-item-active>.md-list-gutter {
|
|
791
|
+
height: 1lh;
|
|
792
|
+
align-items: center;
|
|
793
|
+
}
|
|
794
|
+
|
|
751
795
|
|
|
752
796
|
/*
|
|
753
797
|
* Re-attributed source indentation (the spaces after a line break that precede
|