From a7aaf37d797d620728fa859ea28bdd6a21da9aa5 Mon Sep 17 00:00:00 2001 From: LynithDev <61880709+LynithDev@users.noreply.github.com> Date: Wed, 8 May 2024 22:01:23 +0200 Subject: [PATCH] fix: UnoCSS issues --- desktop/package.json | 1 + desktop/src-tauri/tauri.conf.json | 4 +- desktop/src/globals.css | 23 +++++++--- desktop/src/{global_assets.ts => imports.ts} | 2 + desktop/src/index.tsx | 2 +- desktop/src/ui/components/Navbar.tsx | 6 +-- desktop/src/ui/components/overlay/Popup.tsx | 2 +- desktop/uno.config.ts | 46 ++++++++++---------- pnpm-lock.yaml | 3 ++ 9 files changed, 53 insertions(+), 36 deletions(-) rename desktop/src/{global_assets.ts => imports.ts} (75%) diff --git a/desktop/package.json b/desktop/package.json index dbe1a6d9..c9108b8e 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -23,6 +23,7 @@ "@tauri-apps/api": "^2.0.0-beta", "@tauri-apps/plugin-shell": "github:tauri-apps/tauri-plugin-shell#v2", "@thisbeyond/solid-dnd": "^0.7.5", + "@unocss/reset": "^0.59.4", "@untitled-theme/icons-solid": "^0.8.0", "overlayscrollbars": "^2.7.3", "overlayscrollbars-solid": "^0.5.5", diff --git a/desktop/src-tauri/tauri.conf.json b/desktop/src-tauri/tauri.conf.json index 5642aa8f..5839c55d 100644 --- a/desktop/src-tauri/tauri.conf.json +++ b/desktop/src-tauri/tauri.conf.json @@ -44,8 +44,8 @@ "hiddenTitle": true, "width": 1280, "height": 802, - "minWidth": 700, - "minHeight": 1100, + "minWidth": 600, + "minHeight": 400, "resizable": true, "center": true, "decorations": false, diff --git a/desktop/src/globals.css b/desktop/src/globals.css index e9b14d4e..d7738ecf 100644 --- a/desktop/src/globals.css +++ b/desktop/src/globals.css @@ -3,9 +3,20 @@ body { } /* start lynith's native experience (tm) */ -* { user-select: none; cursor: default !important; } -*:hover { cursor: default !important; } -img { -webkit-user-drag: none; } +* { + user-select: none; + -webkit-user-select: none; + cursor: default !important; + animation-duration: 150ms !important; +} + +*:hover { + cursor: default !important; +} + +img { + -webkit-user-drag: none; +} /* end lynith's native experience (tm) */ h1 { @apply text-2xl font-semibold; } @@ -16,7 +27,7 @@ h4 { @apply text-lg font-medium; } .os-scrollbar { --os-size: 10px; --os-track-border-radius: theme(borderRadius.lg); - --os-handle-bg: theme(colors.gray[0.05]); - --os-handle-bg-hover: theme(colors.gray[0.10]); - --os-handle-bg-active: theme(colors.gray[0.05]); + /* --os-handle-bg: theme("colors.gray[0.05]"); + --os-handle-bg-hover: theme(colors.gray[0.10]); */ + /* --os-handle-bg-active: theme(colors.gray[0.05]); */ } diff --git a/desktop/src/global_assets.ts b/desktop/src/imports.ts similarity index 75% rename from desktop/src/global_assets.ts rename to desktop/src/imports.ts index 74f9c52c..1cb37d83 100644 --- a/desktop/src/global_assets.ts +++ b/desktop/src/imports.ts @@ -1,6 +1,8 @@ +import '@unocss/reset/tailwind.css'; import '@fontsource/poppins/400.css'; import '@fontsource/poppins/500.css'; import '@fontsource/poppins/600.css'; import 'overlayscrollbars/overlayscrollbars.css'; import 'virtual:uno.css'; +import './globals.css'; diff --git a/desktop/src/index.tsx b/desktop/src/index.tsx index d92951fc..160d74a0 100644 --- a/desktop/src/index.tsx +++ b/desktop/src/index.tsx @@ -1,7 +1,7 @@ /* @refresh reload */ import { render } from 'solid-js/web'; -import './global_assets'; +import './imports'; import { Route, Router } from '@solidjs/router'; import App from './ui/App'; diff --git a/desktop/src/ui/components/Navbar.tsx b/desktop/src/ui/components/Navbar.tsx index 9c016c74..61b9c422 100644 --- a/desktop/src/ui/components/Navbar.tsx +++ b/desktop/src/ui/components/Navbar.tsx @@ -16,7 +16,7 @@ function NavbarLink(props: NavbarLinkProps) { return ( +
-
+
diff --git a/desktop/src/ui/components/overlay/Popup.tsx b/desktop/src/ui/components/overlay/Popup.tsx index 83fef3bb..c25cd7af 100644 --- a/desktop/src/ui/components/overlay/Popup.tsx +++ b/desktop/src/ui/components/overlay/Popup.tsx @@ -54,7 +54,7 @@ function Popup(props: Popup.PopupProps) { return ( -
+
{props.children}
diff --git a/desktop/uno.config.ts b/desktop/uno.config.ts index 629ef90e..3cea9356 100644 --- a/desktop/uno.config.ts +++ b/desktop/uno.config.ts @@ -10,6 +10,15 @@ import { export default defineConfig({ rules: [], shortcuts: {}, + presets: [ + presetUno(), + presetAttributify(), + presetIcons(), + ], + transformers: [ + transformerVariantGroup(), + transformerDirectives(), + ], theme: { fontFamily: { sans: 'Poppins', @@ -100,30 +109,21 @@ export default defineConfig({ mdlg: '0.438rem', }, - animation: { - 'fade-in': 'fadeIn 150ms easeOutExpo forwards', - 'fade-out': 'fadeOut 150ms easeOutExpo forwards', - }, + // animation: { + // 'fade-in': 'fadeIn 150ms easeOutExpo forwards', + // 'fade-out': 'fadeOut 150ms easeOutExpo forwards', + // }, - keyframes: { - fadeIn: { - '0%': { opacity: '0' }, - '100%': { opacity: '1' }, - }, - fadeOut: { - '0%': { opacity: '1' }, - '100%': { opacity: '0' }, - }, - }, + // keyframes: { + // fadeIn: { + // '0%': { opacity: '0' }, + // '100%': { opacity: '1' }, + // }, + // fadeOut: { + // '0%': { opacity: '1' }, + // '100%': { opacity: '0' }, + // }, + // }, }, }, - presets: [ - presetUno(), - presetAttributify(), - presetIcons(), - ], - transformers: [ - transformerVariantGroup(), - transformerDirectives(), - ], }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cef8df1e..dc5646cd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,6 +47,9 @@ importers: '@thisbeyond/solid-dnd': specifier: ^0.7.5 version: 0.7.5(solid-js@1.8.17) + '@unocss/reset': + specifier: ^0.59.4 + version: 0.59.4 '@untitled-theme/icons-solid': specifier: ^0.8.0 version: 0.8.0(solid-js@1.8.17)