cssobsidian

Background Gradient Not Appearing in Obsidian with Custom CSS


I'm trying to set a custom background gradient in Obsidian using the following CSS snippet:

.workspace,
.markdown-preview-view,
.markdown-source-view,
.side-dock,
.mod-root {
  background-color: transparent !important;
}

body {
  background-size: 500px 500px;
  background-image: radial-gradient(circle, #000000 1px, rgba(0, 0, 0, 0) 1px);
}

However, the background gradient is not appearing as expected. I've ensured that the CSS is applied correctly, but it seems to be overridden or ignored.

What I've checked:


Solution

  • It is not visible because you have used 1px in background-image its soo small that its not visible so try to use higher properties like 10% which I have used in below example ( See in full page view ).

    If I have misunderstood or missed something then do share.

    body {
      background-size: 500px 500px;
      background-image: radial-gradient(circle, #000000 10%, rgba(0, 0, 0, 0) 10%);
    }
    <h2>
      CleanCodeEditor
    </h2>