How to add padding on .cm-gutterElement?

I want to add left and right padding to .cm-gutterElement. I was adding padding-left: 1rem and padding-right: 1rem on .cm-gutterElement using EditorView.theme but it doesn’t work.


The line number gutter has its own explicit padding style, specified with a higher-precedence rule (.cm-lineNumbers .cm-gutterElement), which is why your rule isn’t taking effect. You could give your rule a higher precedence by making it more specific.

1 Like