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

Syntax highlighted code blocks render as gray on gray for unsupported languages in dark theme #6797

Closed
stof opened this issue May 16, 2019 · 7 comments
Assignees
Milestone

Comments

@stof
Copy link
Contributor

stof commented May 16, 2019

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create a markdown note for a story
  2. Put a code block in it using a language for which highlighting is not loaded in storybook (I used ```twig when discovering the bug)
  3. use the dark theme for your storybook
  4. go to the notes panel to see these notes

Expected behavior
The code block is readable (as happens in light themes).

Screenshots
storybook_bug_dark
storybook_bug_light

Code snippets

This component is not meant to be rendered manually, but using Pagerfanta:

```twig
<div class="text-center spacer-outer-top-tiny">
    {{ pagerfanta(members, 'material') }}
</div>
```

System:

  • OS: Ubuntu 18.04
  • Browser: firefox
  • Framework: html (but irrelevant here)
  • Addons: notes
  • Version: 5.0.11

Additional context
Note that disabling syntax highlighting (by removing the language on the codeblock) makes the text readable (but we miss the copy option then).

@stof
Copy link
Contributor Author

stof commented May 16, 2019

On a side note, I would be interested in getting an answer on #6144 as well (because this codeblock would be even better with proper highlighting.

@shilman shilman added this to the 5.0.x milestone May 16, 2019
@ndelangen
Copy link
Member

I'll see what I can do

@shilman
Copy link
Member

shilman commented May 17, 2019

@ndelangen you might want to check out the changes @domyen made in the release/docs-technical-preview branch. We have nice syntax highlighting for the Source block in both light & dark modes.

@ndelangen
Copy link
Member

@stof Would you like to review my PR?

@shilman
Copy link
Member

shilman commented May 21, 2019

Great Caesar's ghost!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-rc.0 containing PR #6814 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@ChazUK
Copy link

ChazUK commented Nov 24, 2021

@shilman I know this is a long closed ticket, but I'm trying to pass language="scss" to the <Source /> block in @storybook/addon-docs with version 6.3.0 and I'm still getting an unhighlighted grey block. Is there something I am missing to add support for more languages?

@ChazUK
Copy link

ChazUK commented Nov 24, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants