Skip to content
Snippets Groups Projects
Commit 19a50763 authored by syuilo's avatar syuilo
Browse files

lint fixes

parent 3a4039e2
No related branches found
No related tags found
No related merge requests found
......@@ -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());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment