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

feat!: migrate to shiki v1 #1265

Merged
merged 4 commits into from
Feb 2, 2024
Merged

feat!: migrate to shiki v1 #1265

merged 4 commits into from
Feb 2, 2024

Conversation

antfu
Copy link
Member

@antfu antfu commented Feb 2, 2024

This PR removes highlighter: shikiji support. Use highlighter: shiki instead. Breaking changes between shiki v0.x to shiki v1 applies. For example, if you are using loadTheme in shiki setup, change it to manual fs reads instead.

This PR also improves the TwoSlash support by using floating-vue

@antfu antfu merged commit f9e1c65 into main Feb 2, 2024
8 checks passed
@antfu antfu deleted the feat/shiki-v1 branch February 2, 2024 13:59
@John98Zakaria
Copy link
Contributor

John98Zakaria commented Feb 25, 2024

I was using shikji as a highlighter as it had a nicer theme.
Do you happen to know how I can get the theme back in Shiki ?

Before (transparent background)
image

After
image

Update for anyone crying about their lost styles, add this to your styles.css and you are back in business


/* Shikiji */
html.dark .shiki {
  color: var(--shiki-dark, inherit);
  background: var(--shiki-dark-bg, inherit);
  --twoslash-popup-bg: var(--shiki-dark-bg, inherit);
}

html.dark .shiki span {
  color: var(--shiki-dark);
}

html:not(.dark) .shiki {
  color: var(--shiki-light, inherit);
  background: var(--shiki-light-bg, inherit);
  --twoslash-popup-bg: var(--shiki-light-bg, inherit);
}

html:not(.dark) .shiki span {
  color: var(--shiki-light);
}



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

Successfully merging this pull request may close these issues.

2 participants