Shiki settings preview (#297)

This commit is contained in:
Justice Almanzar 2022-12-07 09:33:40 -05:00 committed by GitHub
parent 49b45d8262
commit 2d08dd8a9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 6 deletions

View file

@ -21,6 +21,7 @@ import { parseUrl } from "@utils/misc";
import { wordsFromPascal, wordsToTitle } from "@utils/text";
import definePlugin, { OptionType } from "@utils/types";
import previewExampleText from "~fileContent/previewExample.tsx";
import cssText from "~fileContent/style.css";
import { Settings } from "../../Vencord";
@ -59,6 +60,12 @@ export default definePlugin({
shiki.destroy();
clearStyles();
},
settingsAboutComponent: ({ tempSettings }) => createHighlighter({
lang: "tsx",
content: previewExampleText,
isPreview: true,
tempSettings,
}),
options: {
theme: {
type: OptionType.SELECT,
@ -137,7 +144,10 @@ export default definePlugin({
description: "Background opacity",
markers: [0, 20, 40, 60, 80, 100],
default: 100,
stickToMarkers: false,
componentProps: {
stickToMarkers: false,
onValueRender: null, // Defaults to percentage
},
},
},