Refactor
This commit is contained in:
parent
2c25b261d4
commit
90b9f67827
2 changed files with 17 additions and 14 deletions
16
view/helpers.ts
Normal file
16
view/helpers.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/**
|
||||||
|
* No-op tag function for CSS tagged templates, which works only as a hint for IDE for CSS syntax highlighting.
|
||||||
|
*/
|
||||||
|
export function css(
|
||||||
|
strings: TemplateStringsArray,
|
||||||
|
...exprs: Array<unknown>
|
||||||
|
): string {
|
||||||
|
let result = strings[0];
|
||||||
|
|
||||||
|
for (let i = 1, l = strings.length; i < l; i++) {
|
||||||
|
result += exprs[i - 1];
|
||||||
|
result += strings[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
import { defineConfig } from "unocss";
|
import { defineConfig } from "unocss";
|
||||||
import presetMini, { theme, Theme } from "@unocss/preset-mini";
|
import presetMini, { theme, Theme } from "@unocss/preset-mini";
|
||||||
|
import { css } from "./helpers";
|
||||||
|
|
||||||
const globalCss = (theme: Required<Theme>) => css`
|
const globalCss = (theme: Required<Theme>) => css`
|
||||||
/* This file is dynamically generated. Do not edit this file. */
|
/* This file is dynamically generated. Do not edit this file. */
|
||||||
|
@ -264,20 +265,6 @@ const globalCss = (theme: Required<Theme>) => css`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
/**
|
|
||||||
* No-op tag function for CSS tagged templates, which works only as a hint for IDE for CSS syntax highlighting.
|
|
||||||
*/
|
|
||||||
function css(strings: TemplateStringsArray, ...exprs: Array<unknown>): string {
|
|
||||||
let result = strings[0];
|
|
||||||
|
|
||||||
for (let i = 1, l = strings.length; i < l; i++) {
|
|
||||||
result += exprs[i - 1];
|
|
||||||
result += strings[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
presets: [presetMini()],
|
presets: [presetMini()],
|
||||||
theme: {
|
theme: {
|
||||||
|
|
Loading…
Reference in a new issue