bennyxguo / Obsidian-Obsidianite

🎨 Obsidian.md custom theme, it's dark and simple but yet still stays sparkles!
MIT License
285 stars 50 forks source link

there is a problem with code block here. #52

Closed buthow-top closed 2 years ago

buthow-top commented 2 years ago

like this

it can be fixed like this,change top:-5% to -60%

.cm-s-obsidian div.HyperMD-codeblock-begin-bg:before { position: absolute; content: ''; top: -60%; left: 0; width: 100%; height: 60%; border-top-left-radius: 0.3em; border-top-right-radius: 0.3em; background-color: #191621; }

Leiyi548 commented 2 years ago

@buthow-top Thanks for the snippet

AzadKshitij commented 2 years ago

I was having some issues even after applying the snippet This is what worked for me

.cm-s-obsidian div.HyperMD-codeblock-begin-bg:before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  margin-top: 1.5em;
  border-top-left-radius: 0.3em;
  border-top-right-radius: 0.3em;
  background-color: #191621;
}
mirokrastanov commented 2 years ago

Thank You, guys. Your suggestions helped me fix the same issue. :)

I also had an issue with the bottom part of the code block as well so I tried a few options, inspired by your comments and this works for me:

.cm-s-obsidian div.HyperMD-codeblock-end-bg:before {
  position: absolute;
  content: '';
  bottom: -39%;
  left: 0;
  width: 100%;
  height: 0%;
  margin-bottom: 1.5em;
  border-bottom-left-radius: 0.3em;
  border-bottom-right-radius: 0.3em;
  background-color: #191621;
}

Hope this helps someone. ;)

samholmes commented 2 years ago

Can someone issue a PR for these fixes?

kalico1 commented 2 years ago

Thanks all. This is my favorite theme, but that code block issue has been really driving me crazy. The first fix (-60%) worked for me.