From 90b9f67827de4430531231bdb29347e92f2fbac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondr=CC=8Cej=20Ny=CC=81vlt?= Date: Tue, 5 Sep 2023 22:06:16 +0200 Subject: [PATCH] Refactor --- view/helpers.ts | 16 ++++++++++++++++ view/uno.config.ts | 15 +-------------- 2 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 view/helpers.ts diff --git a/view/helpers.ts b/view/helpers.ts new file mode 100644 index 0000000..7ee57ba --- /dev/null +++ b/view/helpers.ts @@ -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 +): string { + let result = strings[0]; + + for (let i = 1, l = strings.length; i < l; i++) { + result += exprs[i - 1]; + result += strings[i]; + } + + return result; +} diff --git a/view/uno.config.ts b/view/uno.config.ts index 7b471c9..ac59246 100644 --- a/view/uno.config.ts +++ b/view/uno.config.ts @@ -1,5 +1,6 @@ import { defineConfig } from "unocss"; import presetMini, { theme, Theme } from "@unocss/preset-mini"; +import { css } from "./helpers"; const globalCss = (theme: Required) => css` /* This file is dynamically generated. Do not edit this file. */ @@ -264,20 +265,6 @@ const globalCss = (theme: Required) => 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): 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({ presets: [presetMini()], theme: {