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

Shiki theme not applying on code block background #2015

Open
Neluji opened this issue Jan 20, 2025 · 0 comments
Open

Shiki theme not applying on code block background #2015

Neluji opened this issue Jan 20, 2025 · 0 comments

Comments

@Neluji
Copy link

Neluji commented Jan 20, 2025

Describe the bug

When using a theme for shiki, the colours are effectively applied to the text, but the background of the code blocks remains in the default colour.

Minimal reproduction

Steps to reproduce the behavior:

  1. Create a new Slidev project:
    npm init slidev@latest / pnpm create slidev / yarn create slidev
    and install the dependencies
  2. In the project, create a setup folder, and in it, a shiki.ts file (as specified in the doc) with the following content:
    /* ./setup/shiki.ts */
    import { defineShikiSetup } from "@slidev/types";
    
    export default defineShikiSetup(() => {
      return {
        themes: {
          dark: "min-light",
          light: "min-dark",
        },
      };
    });
    this should apply a dark theme to the code when in light mode, and vice-versa
  3. Launch the dev server and open the slide using the dev npm script
  4. Go to the 5th slide where there is some code blocks: the colour of the code is the one from the shiki theme (i.e. colours of the min-dark code theme when in light mode and vice-versa), but the background remains the default one (i.e. a light background when in light mode and vice-versa)

System infos

  • Slidev version: 51.0.2
  • Browser: Firefox
  • OS: Ubuntu
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

1 participant