GithubHelp home page GithubHelp logo

Colors don’t match VS Code about shiki HOT 10 CLOSED

shikijs avatar shikijs commented on July 18, 2024
Colors don’t match VS Code

from shiki.

Comments (10)

octref avatar octref commented on July 18, 2024 1

Soon, doing the release preps.

from shiki.

leafac avatar leafac commented on July 18, 2024 1

Awesome. This is perfect now. One more time: Thank you very much for this project!

from shiki.

octref avatar octref commented on July 18, 2024

You are right, it seems to be using color of light theme, not light plus.

from shiki.

leafac avatar leafac commented on July 18, 2024

That’s what I thought too. Why is this happening? How can I help investigate?

from shiki.

leafac avatar leafac commented on July 18, 2024

Another case. Note the {} and the ; on the output type:

Visual Studio Code

Screen Shot 2020-04-15 at 2 54 03 PM

(Ignore the red squiggly.)

Shiki

Screen Shot 2020-04-15 at 2 55 01 PM

Program Used to Produce Shiki Output
const shiki = require("shiki");

shiki
  .getHighlighter({
    theme: "light_plus",
  })
  .then((highlighter) => {
    console.log(
      highlighter.codeToHtml(
        `function f(): { key: Type; otherKey: otherType } {}`,
        "ts"
      )
    );
  });

from shiki.

octref avatar octref commented on July 18, 2024

Upgrade to 0.1.7, which includes the updated Light+ theme.

from shiki.

leafac avatar leafac commented on July 18, 2024

Thank you.

I tried both cases I reported and only the second is fixed. The return in return 'shiki'; still shows up in blue, not pink like I see in VS Code.

from shiki.

octref avatar octref commented on July 18, 2024

Probably, I need to update the grammar as well 😅

from shiki.

octref avatar octref commented on July 18, 2024

Seems fixed:

image

const shiki = require('shiki')

shiki.getHighlighter({
  theme: 'light-plus'
}).then(highlighter => {
  console.log(highlighter.codeToHtml(`return 'shiki';`, 'js'))
  console.log(highlighter.codeToHtml(`function f(): { key: Type; otherKey: otherType } {}`, 'ts'))
})

from shiki.

leafac avatar leafac commented on July 18, 2024

I suppose you haven’t released the fixed version to npm yet, because my original example still shows return in blue and your example above fails as the theme is called light_plus, not light-plus. When do you plan on releasing the fixed version?

from shiki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.