Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

there is a problem with code block here. #52

Closed
buthow-top opened this issue Jun 1, 2022 · 5 comments
Closed

there is a problem with code block here. #52

buthow-top opened this issue Jun 1, 2022 · 5 comments

Comments

@buthow-top
Copy link

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
Copy link

Leiyi548 commented Jun 6, 2022

@buthow-top Thanks for the snippet

@AzadKshitij
Copy link

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
Copy link

mirokrastanov commented Jul 13, 2022

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
Copy link

Can someone issue a PR for these fixes?

@kalico1
Copy link

kalico1 commented Sep 25, 2022

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.

bennyxguo pushed a commit that referenced this issue Oct 9, 2022
### New Diamonds 💎

- Removed all the old `Cluster Free` code (please move to `live preview` mode)
- Added support for `live preview` mode [#44]
  - Supporting all the features that is there fore for live preview

### Fixes

- Problem with code block should no longer exist with `live preview` [#52]
- Images now align to left, fixed issue with image having no spaces between list items [#50][#34]
- Fixed issue with strange block that hides top of the page in edit mode with `live preview` [#47]
- Fixed bullet point not visible in view mode [#45]
- Fixed bullet lists in edit mode not compatible with different fonts [#32]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants