0.0.6 • Published 1 year ago

@mollbe/theme-compiler v0.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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)