lint fixes
This commit is contained in:
parent
3a4039e2e1
commit
19a507633e
|
@ -286,8 +286,7 @@ definePageMetadata(computed(() => {
|
|||
let title = i18n.ts._pages.newPage;
|
||||
if (props.initPageId) {
|
||||
title = i18n.ts._pages.editPage;
|
||||
}
|
||||
else if (props.initPageName && props.initUser) {
|
||||
} else if (props.initPageName && props.initUser) {
|
||||
title = i18n.ts._pages.readPage;
|
||||
}
|
||||
return {
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
|
||||
import { ref } from 'vue';
|
||||
import tinycolor from 'tinycolor2';
|
||||
import { globalEvents } from '@/events';
|
||||
import { deepClone } from './clone.js';
|
||||
import { globalEvents } from '@/events.js';
|
||||
import lightTheme from '@/themes/_light.json5';
|
||||
import darkTheme from '@/themes/_dark.json5';
|
||||
import { miLocalStorage } from '@/local-storage.js';
|
||||
|
||||
export type Theme = {
|
||||
id: string;
|
||||
|
@ -16,11 +20,6 @@ export type Theme = {
|
|||
props: Record<string, string>;
|
||||
};
|
||||
|
||||
import lightTheme from '@/themes/_light.json5';
|
||||
import darkTheme from '@/themes/_dark.json5';
|
||||
import { deepClone } from './clone';
|
||||
import { miLocalStorage } from '@/local-storage.js';
|
||||
|
||||
export const themeProps = Object.keys(lightTheme.props).filter(key => !key.startsWith('X'));
|
||||
|
||||
export const getBuiltinThemes = () => Promise.all(
|
||||
|
@ -101,18 +100,11 @@ export function applyTheme(theme: Theme, persist = true) {
|
|||
|
||||
function compile(theme: Theme): Record<string, string> {
|
||||
function getColor(val: string): tinycolor.Instance {
|
||||
// ref (prop)
|
||||
if (val[0] === '@') {
|
||||
if (val[0] === '@') { // ref (prop)
|
||||
return getColor(theme.props[val.substring(1)]);
|
||||
}
|
||||
|
||||
// ref (const)
|
||||
else if (val[0] === '$') {
|
||||
} else if (val[0] === '$') { // ref (const)
|
||||
return getColor(theme.props[val]);
|
||||
}
|
||||
|
||||
// func
|
||||
else if (val[0] === ':') {
|
||||
} else if (val[0] === ':') { // func
|
||||
const parts = val.split('<');
|
||||
const func = parts.shift().substring(1);
|
||||
const arg = parseFloat(parts.shift());
|
||||
|
|
Loading…
Reference in New Issue