From 35dc5bd2a5ddd0ea362c3029a4a8e10c2fdc72e4 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Fri, 6 Mar 2026 19:01:14 +0300 Subject: [PATCH] Extract menu styling with tailwind-variants --- bun.lock | 6 +++ package.json | 2 + src/components/AppMenu.vue | 19 +++++---- src/components/MobileHud.vue | 5 ++- src/components/NodeContextMenuContent.vue | 21 +++++----- src/components/Toolbar.vue | 15 +++---- src/components/properties/StrokeSection.vue | 5 ++- src/components/ui/menu.ts | 44 +++++++++++++++++++++ 8 files changed, 83 insertions(+), 34 deletions(-) create mode 100644 src/components/ui/menu.ts diff --git a/bun.lock b/bun.lock index 23b2f49ff..02a824008 100644 --- a/bun.lock +++ b/bun.lock @@ -28,6 +28,8 @@ "motion-v": "^2.0.0", "prismjs": "^1.30.0", "reka-ui": "^2.9.0", + "tailwind-merge": "^3.5.0", + "tailwind-variants": "^3.2.2", "tailwindcss": "^4.2.1", "trystero": "^0.22.0", "valibot": "^1.2.0", @@ -2163,6 +2165,10 @@ "tabbable": ["tabbable@6.4.0", "", {}, "sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg=="], + "tailwind-merge": ["tailwind-merge@3.5.0", "", {}, "sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A=="], + + "tailwind-variants": ["tailwind-variants@3.2.2", "", { "peerDependencies": { "tailwind-merge": ">=3.0.0", "tailwindcss": "*" }, "optionalPeers": ["tailwind-merge"] }, "sha512-Mi4kHeMTLvKlM98XPnK+7HoBPmf4gygdFmqQPaDivc3DpYS6aIY6KiG/PgThrGvii5YZJqRsPz0aPyhoFzmZgg=="], + "tailwindcss": ["tailwindcss@4.2.1", "", {}, "sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw=="], "tapable": ["tapable@2.3.0", "", {}, "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg=="], diff --git a/package.json b/package.json index ca526a301..a11ac073b 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,8 @@ "motion-v": "^2.0.0", "prismjs": "^1.30.0", "reka-ui": "^2.9.0", + "tailwind-merge": "^3.5.0", + "tailwind-variants": "^3.2.2", "tailwindcss": "^4.2.1", "trystero": "^0.22.0", "valibot": "^1.2.0", diff --git a/src/components/AppMenu.vue b/src/components/AppMenu.vue index c149bb0f8..5424b31cb 100644 --- a/src/components/AppMenu.vue +++ b/src/components/AppMenu.vue @@ -18,6 +18,7 @@ import IconChevronRight from '~icons/lucide/chevron-right' import { ref } from 'vue' +import { menuContent, menuItem, menuSeparator } from '@/components/ui/menu' import { IS_TAURI } from '@/constants' import { openFileDialog } from '@/composables/use-menu' import { useEditorStore } from '@/stores/editor' @@ -214,13 +215,13 @@ const topMenus = [