Custom CodeMirror6 editor themes for @codeimage/app
CodeImage editor themes are made by the internal createTheme
api function.
Each theme must implement the CustomTheme interface that provides binding for CodeMirror editor theme and the style for the theme switcher preview.
To create a new theme, you need to run the generate:theme
command.
$ pnpm generate:theme
It will ask you for a name of for the theme.
Warning Theme name must be in lower camel case.
ex. githubDark is a valid theme name.
The script will do the following:
- Creates a new folder in the
src/lib/themes
folder with the name you used. - Generate a
index.ts
and{{yourTheme}}.ts
file in the new folder. - Automatically add the
export
andtypesVersion
entry in the package.json