Skip to content

Commit d222e1c

Browse files
committed
nicer gutters
1 parent ee14eb4 commit d222e1c

File tree

3 files changed

+38
-10
lines changed

3 files changed

+38
-10
lines changed
Lines changed: 2 additions & 2 deletions
Loading

packages/editor/src/lib/Editor.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
116116
.fake-gutter {
117117
text-align: right;
118-
padding-right: 3px;
118+
padding-right: 0.7rem;
119119
}
120120
121121
.fake-content {

packages/editor/src/lib/codemirror.css

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,48 @@
3838
}
3939

4040
.cm-activeLine {
41+
background: inherit;
42+
}
43+
44+
.cm-foldGutter {
45+
width: 1.4rem;
46+
}
47+
48+
.cm-activeLineGutter {
49+
position: relative;
50+
4151
/* this must be translucent, or it will obscure the selection */
4252
background: hsl(0, 0%, 0%, 0.04);
4353

4454
:root.dark & {
4555
background: hsl(0, 0%, 100%, 0.04);
4656
}
47-
}
4857

49-
.cm-activeLineGutter {
50-
background-color: var(--sk-bg-3);
58+
span {
59+
position: absolute;
60+
display: block;
61+
width: 100%;
62+
height: 100%;
63+
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+
}
78+
79+
&[title='Fold line']::after {
80+
rotate: 0deg;
81+
}
82+
}
5183
}
5284

5385
.cm-lineNumbers {
@@ -60,10 +92,6 @@
6092
}
6193
}
6294

63-
.cm-foldGutter {
64-
width: 1rem;
65-
}
66-
6795
.cm-foldPlaceholder {
6896
background-color: transparent;
6997
border: none;

0 commit comments

Comments
 (0)