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

Adding code snippets breaks dark theme #94

Closed
3 tasks done
Ppjet6 opened this issue Feb 6, 2023 · 18 comments
Closed
3 tasks done

Adding code snippets breaks dark theme #94

Ppjet6 opened this issue Feb 6, 2023 · 18 comments
Labels
bug Something isn't working

Comments

@Ppjet6
Copy link

Ppjet6 commented Feb 6, 2023

I have checked all the prerequisites below and I'm yet experiencing a problem

  • Read the README.md
  • Have the extended version of Hugo installed
  • Used the exampleSite's config.toml as a reference

Describe the bug

When I use blockquotes in markdown, the blockquote is properly displayed on the page but I am forced back in the light theme and it's not possible to change this. It also breaks some other parts of the page, such as parts of the left navbar.

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Firefox nightly 111.0a1
@Ppjet6 Ppjet6 added the bug Something isn't working label Feb 6, 2023
@onweru
Copy link
Owner

onweru commented Feb 7, 2023

@Ppjet6, that's by design.

@onweru
Copy link
Owner

onweru commented Feb 7, 2023

If you want to adjust the chroma classes, you're out of luck with this theme. I should make that clear in the docs.

@Ppjet6
Copy link
Author

Ppjet6 commented Feb 8, 2023

Is it by design that blockquotes break the theme?

@onweru
Copy link
Owner

onweru commented Feb 8, 2023

Umh, is that the same issue or a separate issue?

@Ppjet6
Copy link
Author

Ppjet6 commented Feb 8, 2023

It's the same issue. It's the html that gets generated when I use blockquotes, as mentioned in the first post.

@onweru
Copy link
Owner

onweru commented Feb 8, 2023

It seems I misunderstood and misspoke. That said, I still don't get what pre@class="chroma" in the title has to do with a blockquote.

Did a quick test and couldn't quite reproduce what you've described. Can you paste an example here? or send me a link

@Ppjet6
Copy link
Author

Ppjet6 commented Feb 8, 2023

https://codeberg.org/joinjabber/website-hugo/commit/3874c788bd7849d6b9f6ae93710265af9e254720

This is an example of a workaround for this issue (code blocks). I guess you can clone the website to try and reproduce.

@onweru
Copy link
Owner

onweru commented Feb 8, 2023

By all means. You didn't provide an actual example where the problem was happening. I see no blockquotes on the link, or how the chroma class is relevant.

@poVoq
Copy link

poVoq commented Feb 8, 2023

Something on our website currently breaks block-quotes. I have a suspicion that it might be related to adding the custom.js as explained here: https://docs.neuralvibes.com/docs/compose/customize/#i-want-to-add-custom-sass-or-js

@Ppjet6
Copy link
Author

Ppjet6 commented Feb 8, 2023

Yeah it seems whatever generates <pre class="chroma"> breaks our theme currently. That's at least blockquotes and code blocks.

@onweru
Copy link
Owner

onweru commented Feb 8, 2023

Or maybe you have different markup settings . If that's the case, that would explain it.

@onweru
Copy link
Owner

onweru commented Feb 8, 2023

The markup settings should match 👇🏼 as is in the exampleSite.

codeFences = true
  guessSyntax = false
  hl_Lines = ""
  lineNoStart = 1
  lineNos = true
  lineNumbersInTable = false
  noClasses = false
  style = "monokai"
  tabWidth = 2

@Ppjet6
Copy link
Author

Ppjet6 commented Feb 9, 2023

Ok it looks like this is unrelated to chroma anyway. I tried removing the only place in your code that adds it to <pre> and it didn't fix it.

We use the default configuration so this isn't it either.

It's probably something in our custom sass that breaks it as @poVoq said. We need to figure out what.

@ltguillaume
Copy link
Contributor

ltguillaume commented Feb 9, 2023

For me, this only happens when I use a code block, so 3x tilde like

this

These code blocks do indeed have the class chroma.

It has nothing to do with custom SASS (I removed it all when testing).

@onweru
Copy link
Owner

onweru commented Feb 9, 2023

@ltguillaume, @Ppjet6,

If I could see your repos, pretty confident I would point out what the problem is. I looked at your profiles and figured you're testing privately.

onweru added a commit that referenced this issue Feb 9, 2023
@ltguillaume
Copy link
Contributor

@Ppjet6 has linked to it twice here, but it's https://codeberg.org/joinjabber/website-hugo/

There is no code block added to main branch right now because of the issue, but just add it yourself and you'll see it.

onweru added a commit that referenced this issue Feb 9, 2023
@onweru
Copy link
Owner

onweru commented Feb 9, 2023

@ltguillaume, thank you that clarification went a long way. It wasn't immediately obvious that was the fork. Plus the talk about blockquotes didn't help with the misunderstanding. This issue was about the code blocks/snippets breaking certain javascript functions.

I have tested with your repo and discovered a javascript bug. Your repo should now work properly 👇🏼, after pulling the update.

SCR-20230209-qwp

@onweru onweru changed the title [BUG] pre@class="chroma" breaks dark theme Adding code snippets breaks dark theme Feb 9, 2023
@Ppjet6
Copy link
Author

Ppjet6 commented Feb 9, 2023

Thanks! This indeed fixes it.

To explain why the baseUrl = "/" if it isn't obvious, we're serving the website over multiple domains, joinjabber.org, and a Tor onion domain!

Sorry again for the confusion and thanks for taking the time.

@Ppjet6 Ppjet6 closed this as completed Feb 9, 2023
hupfdule pushed a commit to poiu-de/compose that referenced this issue May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants