merge: upstream
This commit is contained in:
parent
34b4646b9f
commit
6a94a52131
60 changed files with 741 additions and 190 deletions
|
|
@ -6,6 +6,7 @@
|
|||
import { ref } from 'vue';
|
||||
import tinycolor from 'tinycolor2';
|
||||
import { deepClone } from './clone.js';
|
||||
import type { BuiltinTheme } from 'shiki';
|
||||
import { globalEvents } from '@/events.js';
|
||||
import lightTheme from '@/themes/_light.json5';
|
||||
import darkTheme from '@/themes/_dark.json5';
|
||||
|
|
@ -18,6 +19,13 @@ export type Theme = {
|
|||
desc?: string;
|
||||
base?: 'dark' | 'light';
|
||||
props: Record<string, string>;
|
||||
codeHighlighter?: {
|
||||
base: BuiltinTheme;
|
||||
overrides?: Record<string, any>;
|
||||
} | {
|
||||
base: '_none_';
|
||||
overrides: Record<string, any>;
|
||||
};
|
||||
};
|
||||
|
||||
export const themeProps = Object.keys(lightTheme.props).filter(key => !key.startsWith('X'));
|
||||
|
|
@ -57,7 +65,7 @@ export const getBuiltinThemesRef = () => {
|
|||
|
||||
const themeFontFaceName = 'sharkey-theme-font-face';
|
||||
|
||||
let timeout = null;
|
||||
let timeout: number | null = null;
|
||||
|
||||
export function applyTheme(theme: Theme, persist = true) {
|
||||
if (timeout) window.clearTimeout(timeout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue