Skip to content

Adding a background color has no effect. #33

@digulla

Description

@digulla
  • The Plugin is up to date
  • Obsidian is up to date

Describe the bug
I tried to add a background color for invalid input but the property "background" is ignored. "foreground" works as expected.

I used the same syntax as in your example in

{
"name": "Invalid",
"scope": "invalid",
"settings": {
"background": "#c678dd",
"foreground": "#F8F8F0"
}

To Reproduce
Steps to reproduce the behavior:

Add this rule to your color theme:

	{
		"name": "Invalid",
		"scope": [
			"invalid"
		],
		"settings": {
			"background": "#FFFFFF",
			"foreground": "#FF8080"
		}
	}

I now get red text on the default, dark background color instead of red on white. The CSS of the element is:

<span style="--0:#FF8080">...</span>

The CSS rule

.expressive-code .ec-line :where(span[style^='--']:not([class]))

doesn't define "background-color" and there is no variable for it.

Expected behavior
Both colors should be applied.

Plugin version
0.4.4
Obsidian 1.7.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions