Skip to content

Commit df19a51

Browse files
committed
fix codemirror.less to match CodeMirror's expected padding layout
fixes #2869 (I hope!)
1 parent b884ff9 commit df19a51

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

notebook/static/notebook/less/codemirror.less

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
.CodeMirror-lines {
2727
/* In CM2, this used to be 0.4em, but in CM3 it went to 4px. We need the em value because */
2828
/* we have set a different line-height and want this to scale with that. */
29-
padding: @code_padding;
29+
/* Note that this should set vertical padding only, since CodeMirror assumes
30+
that horizontal padding will be set on CodeMirror pre */
31+
padding: @code_padding 0;
3032
}
3133

3234
.CodeMirror-linenumber {
@@ -43,9 +45,9 @@
4345
}
4446

4547
.CodeMirror pre {
46-
/* In CM3 this went to 4px from 0 in CM2. We need the 0 value because of how we size */
47-
/* .CodeMirror-lines */
48-
padding: 0;
48+
/* In CM3 this went to 4px from 0 in CM2. This sets horizontal padding only,
49+
use .CodeMirror-lines for vertical */
50+
padding: 0 @code_padding;
4951
border: 0;
5052
.border-radius(0)
5153
}

0 commit comments

Comments
 (0)