Skip to content

Commit 6eab1ca

Browse files
committed
better
1 parent 14fe0be commit 6eab1ca

File tree

1 file changed

+19
-33
lines changed

1 file changed

+19
-33
lines changed

packages/editor/src/lib/codemirror.css

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -46,39 +46,35 @@
4646
}
4747

4848
.cm-activeLineGutter {
49-
position: relative;
50-
5149
/* this must be translucent, or it will obscure the selection */
5250
background: hsl(0, 0%, 0%, 0.04);
5351

5452
:root.dark & {
5553
background: hsl(0, 0%, 100%, 0.04);
5654
}
55+
}
5756

58-
span {
57+
.cm-gutterElement {
58+
position: relative;
59+
60+
&:where(:has([title='Fold line']), :has([title='Unfold line']))::after {
61+
content: '';
5962
position: absolute;
60-
display: block;
6163
width: 100%;
62-
height: 100%;
6364
right: 0;
64-
color: transparent;
65-
user-select: none;
66-
67-
&::after {
68-
content: '';
69-
position: absolute;
70-
top: 0.1rem;
71-
left: 0;
72-
width: 100%;
73-
height: 100%;
74-
background: url($lib/icons/chevron.svg) no-repeat 50% 50%;
75-
background-size: contain;
76-
rotate: -90deg;
77-
}
65+
top: 0;
66+
height: 2.4rem;
67+
background: url($lib/icons/chevron.svg) no-repeat 50% 50%;
68+
background-size: contain;
69+
transition: transform 0.2s;
70+
}
7871

79-
&[title='Fold line']::after {
80-
rotate: 0deg;
81-
}
72+
&:has([title='Unfold line'])::after {
73+
transform: rotate(-90deg);
74+
}
75+
76+
span {
77+
color: transparent;
8278
}
8379
}
8480

@@ -113,17 +109,7 @@
113109
}
114110

115111
.cm-content {
116-
/* ensure no gap between top of editor and highlighted first/last line */
117-
padding-top: 0;
118-
padding-bottom: 0;
119-
120-
.cm-line:first-child {
121-
padding-top: 4px;
122-
}
123-
124-
.cm-line:last-child {
125-
padding-bottom: 4px;
126-
}
112+
padding: 0.4rem 0;
127113
}
128114

129115
.cm-line {

0 commit comments

Comments
 (0)