@mollbe/theme-compiler
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

Typescript interface to generate a Theme for Visual Studio Code

  • Uses tinycolor internally and passes it down:

Usage:

import { Theme, tinycolor2 as color } from "@mollbe/theme-compiler";
const [theme, format] = Theme.create([
    'include/some.jsonc'
])

const String = "hsl(175, 100%, 35%)"
format( 'keyword.control.foo', 'hsl(175, 100%, 35%)'' ); // all strings are parsed with tinycolor2
format( 'string.quoted', String);
format( 'string.quoted.single', color(Selection).setAlpha(.2));
format( 'keyword.control.import', 'red', 'bold'); // also reconizes bold, normal, underline, italic
// Note: Name is prefixed with `colors`
format( 'colors.editor.foreground', 'red');
// Note: Name is prefixed with `semantic`
format( 'semantic.class.definiton', color('blue').desaturate(50) );

console.log(
    theme.toString() // valid theme.json for Visual Studio Code
);
// theme.write(filename)

Readme

Keywords

none

Package Sidebar

Install

npm i @mollbe/theme-compiler

Weekly Downloads

0

Version

0.0.6

License

ISC

Unpacked Size

30 kB

Total Files

8

Last publish

Collaborators

  • mollenhauer