From df19a51f59521d39d7131cea1c5650606d6219c8 Mon Sep 17 00:00:00 2001 From: Josh Barnes Date: Sat, 30 Sep 2017 02:47:39 +0100 Subject: [PATCH] fix codemirror.less to match CodeMirror's expected padding layout fixes #2869 (I hope!) --- notebook/static/notebook/less/codemirror.less | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/notebook/static/notebook/less/codemirror.less b/notebook/static/notebook/less/codemirror.less index e423b2f19c..37ca1db75a 100644 --- a/notebook/static/notebook/less/codemirror.less +++ b/notebook/static/notebook/less/codemirror.less @@ -26,7 +26,9 @@ .CodeMirror-lines { /* In CM2, this used to be 0.4em, but in CM3 it went to 4px. We need the em value because */ /* we have set a different line-height and want this to scale with that. */ - padding: @code_padding; + /* Note that this should set vertical padding only, since CodeMirror assumes + that horizontal padding will be set on CodeMirror pre */ + padding: @code_padding 0; } .CodeMirror-linenumber { @@ -43,9 +45,9 @@ } .CodeMirror pre { - /* In CM3 this went to 4px from 0 in CM2. We need the 0 value because of how we size */ - /* .CodeMirror-lines */ - padding: 0; + /* In CM3 this went to 4px from 0 in CM2. This sets horizontal padding only, + use .CodeMirror-lines for vertical */ + padding: 0 @code_padding; border: 0; .border-radius(0) }