bitauth-ide icon indicating copy to clipboard operation
bitauth-ide copied to clipboard

Replace Monaco View Zones hack with proper editor padding

Open bitjson opened this issue 5 years ago • 0 comments

Currently, Monaco editor doesn't support adding any sort of padding to the editor, but there are several strategies which can be used to emulate padding.

With just CSS padding, editor features are also shifted down. Note the scrollbar and scroll-decoration shadow are both 4px below the top of the "Channel" editor title bar:

Screen Shot 2020-05-30 at 1 14 06 PM

We're using the view zone strategy to add a single line of margin to the top of each editor instance. Unfortunately, this requires us to use exactly 18px of padding. If/when Monaco editor supports customizing the padding around the editor, we should replace the current view zones hack (and maybe choose between 6px and 12px for padding).

bitjson avatar May 30 '20 17:05 bitjson