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

Add a small tutorial to switch between multiple themes #800

Open
4 tasks done
Serpentarius13 opened this issue Oct 5, 2024 · 7 comments
Open
4 tasks done

Add a small tutorial to switch between multiple themes #800

Serpentarius13 opened this issue Oct 5, 2024 · 7 comments

Comments

@Serpentarius13
Copy link
Contributor

Clear and concise description of the problem

Right now there is a reproduction on how to do it and it is possible to read between the lines and use source maps, but I think a clear tutorial would be nice

Suggested solution

Write a small step-by-step tutorial on how to switch between multiple themes

Alternative

No response

Additional context

No response

Validations

Contributes

  • If this feature request is accepted, I am willing to submit a PR to fix this issue
@fuma-nama
Copy link
Contributor

fuma-nama commented Oct 12, 2024

Is the guide at https://shiki.style/guide/dual-themes useful for you?

Oh I see what you meant, yes I think it would be a good idea too.

@antfu
Copy link
Member

antfu commented Oct 28, 2024

PR welcome if you want to help, thanks!

@Serpentarius13
Copy link
Contributor Author

Serpentarius13 commented Nov 1, 2024

PR welcome if you want to help, thanks!

Can you please give me a heads-up? What version of the repo is actually used in production documentation? There's an example block on website:
image

Which is nowhere to be found in the markdown file on main branch:

With it, a token would be generated like:

<span style="--shiki-dark:#D8DEE9;--shiki-light:#2E3440">console</span>

In that case, the generated HTML would have no style out of the box, you need to add your own CSS to control the colors.

It's also possible to control the theme in CSS variables. For more, refer to the great research and examples by [@mayank99](https://github.com/mayank99) in [this issue #6](https://github.com/antfu/shikiji/issues/6).

@fuma-nama
Copy link
Contributor

it exists, you can work on the main branch

@Serpentarius13
Copy link
Contributor Author

it exists, you can work on the main branch

But how is it added? Is there some magic in the rendering code?

@fuma-nama
Copy link
Contributor

fuma-nama commented Nov 1, 2024

Hmm what do you mean? It's on the main branch
image

@Serpentarius13
Copy link
Contributor Author

Hmm what do you mean? It's on the main branch image

I'm completely blind! Was looking at a block head. Here's the PR :) #823

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

3 participants