Skip to content

Quarto vscode extension cell color match theme background #675

Closed
@kylebutts

Description

@kylebutts

I'm wondering if you all would welcome a small PR to the vscode extension to improve rendering of cells in quarto documents. I know that you can use cells.background.light/cells.background.dark to change the color, but this requires me to change this every time I switch themes. Adding an option cells.background.useTheme bool that would use notebook.selectedCellBackground theme color. This is a built in color for VSCode's notebooks and most themes will have a customized color.

I think it would be a relatively easy change adding a branch here.

const light = config.get("cells.background.light", "#E1E1E166");
const dark = config.get("cells.background.dark", "#40404066");
this.enabled_ = config.get("cells.background.enabled", true);
this.delayMs_ = config.get("cells.background.delay", 250);
if (this.backgroundDecoration_) {
this.backgroundDecoration_.dispose();
}
this.backgroundDecoration_ = vscode.window.createTextEditorDecorationType({
isWholeLine: true,
light: {
backgroundColor: light,
},
dark: {
backgroundColor: dark,
},
});

See a similar patch to positron-code-cells extension: posit-dev/positron#6633

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions