# convert-sh-theme

> Convert VSCode Themes to Shiki/Code Hike css variables

Latest version **0.1.1** (published 2023-01-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install convert-sh-theme
pnpm add convert-sh-theme
yarn add convert-sh-theme
bun add convert-sh-theme
```

Provides the command `convert-sh-theme`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-01-16 |
| First published | 2023-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 18.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sebastian Sdorra |
| Maintainers | sdorra |
| Keywords | shiki, VSCode, CodeHike, theme |

## Links

- npm: https://www.npmjs.com/package/convert-sh-theme
- npm.io page: https://npm.io/package/convert-sh-theme

## Dependencies (3)

- [shiki](https://npm.io/package/shiki.md) ^0.12.1
- [cmd-ts](https://npm.io/package/cmd-ts.md) ^0.11.0
- [node-fetch-cjs](https://npm.io/package/node-fetch-cjs.md) ^3.2.0

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2023-01-16
- 0.1.0 — 2023-01-16

## README

# convert-sh-theme

Small utility to convert VSCode Themes to Shiki/Code Hike css variables.
For a detailed description how to use the generated variables, have a look at [sdorra.dev](https://sdorra.dev/posts/2023-01-12-ch-dark-mode)

## Example

```bash
$ npx convert-sh-theme https://raw.githubusercontent.com/shikijs/shiki/main/packages/shiki/themes/dracula.json

style.css
=======================================

:root {
  --shiki-color-text: #F8F8F2;
  --shiki-color-background: #282A36;

  --shiki-token-constant: #BD93F9;
  --shiki-token-string: #8BE9FD;
  --shiki-token-comment: #6272A4;
  --shiki-token-keyword: #FF79C6;
  --shiki-token-parameter: #F8F8F2;
  --shiki-token-function: #8BE9FD;
  --shiki-token-string-expression: #FF79C6;
  --shiki-token-punctuation: #F8F8F2;
  --shiki-token-link: #8BE9FD;
}
```

## Usage

Shiki:

```bash
npx convert-sh-theme path/or/url/to/vscode/theme
```

Code Hike:

```bash
npx convert-sh-theme --code-hike path/or/url/vscode/theme
```

The styles can also be written to a directory instead of output to stdout.

```bash
npx convert-sh-theme --out output/directory path/or/url/vscode/theme
```

For a list of all options and parameters use `npx convert-sh-theme --help`.

---
_Source: https://npm.io/package/convert-sh-theme · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
