CSS for customising appearance (colour) of spoilers?

What I’m trying to do

Change the colour of the ‘block’ hiding the spoiler text.

Currently it looks like this
Obsidian_CMP2j656mz

Here, the block is too close to the background, and I’d like to change that.

I’m specifically using the spoiler from Extended markdown syntax plugin with the ||spoiler|| syntax.
But I assume using html for spoiler will also use the appearance for the spoiler.

Things I have tried

Searching leads to css for creating spoilers, not customising appearance.

Those two CSS snippets …

.cm-spoiler {
  .theme-dark & {
    background-color: red;
  }
}

span.spoiler {
  .theme-dark & {
    background-color: red;
  }
}

(top one is for editing and bottom for reading mode)

… change it into this screamy red …

image

I’m not sure what the purpose of .theme-dark is. Maybe this part will be different if you have a light theme.

Cheers, Marko :nerd_face:

EDIT
I just burn my eyes to test it! :smile: … yes, in light theme there is .theme-light

1 Like

Thank you!
That worked.

Nice of you to test the light theme at the cost of your eyesight too.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.