From 94f727dc099b9cba225207898524e3c2676e46bd Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 21 Sep 2021 14:24:17 +0300 Subject: [PATCH] avoid startup flicker in applies-to widget --- edit/edit.css | 3 +++ edit/moz-section-widget.js | 1 + 2 files changed, 4 insertions(+) diff --git a/edit/edit.css b/edit/edit.css index 2680551a..61f52e65 100644 --- a/edit/edit.css +++ b/edit/edit.css @@ -589,6 +589,9 @@ body:not(.find-open) [data-match-highlight-count="1"] .CodeMirror-selection-high align-items: flex-start; min-height: 30px; flex-wrap: wrap; + background-color: #f7f7f7; /* .CodeMirror-gutters */ + border: solid #bbb; + border-width: 1px 0; } .applies-to.error { background-color: #f002; diff --git a/edit/moz-section-widget.js b/edit/moz-section-widget.js index 60d95f18..5588febc 100644 --- a/edit/moz-section-widget.js +++ b/edit/moz-section-widget.js @@ -130,6 +130,7 @@ function MozSectionWidget(cm, finder = MozSectionFinder(cm)) { } finder.on(update); requestAnimationFrame(updateWidgetStyle); + cm.display.wrapper.style.setProperty('--cm-bar-width', cm.display.barWidth + 'px'); } function destroy() {