Skip to content

Commit 04a1533

Browse files
committed
refactor: splitting and reorganizing style files
1 parent 414a639 commit 04a1533

File tree

56 files changed

+412
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+412
-157
lines changed

.editorconfig

-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@ indent_size = 2
1616

1717
[*.md]
1818
trim_trailing_whitespace = false
19-
20-
[Makefile]
21-
indent_style = tab

.vscode/launch.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"version": "0.2.0",
24
"configurations": [
35
{
46
"type": "chrome", // chrome、edge
57
"name": "vben admin pro dev", // 调试的名称,可以自定义
68
"request": "launch",
79
"url": "http://localhost:5173",
10+
"env": { "NODE_ENV": "development" },
11+
"sourceMaps": true,
812
"webRoot": "${workspaceFolder}/apps/web-antd/src"
913
}
1014
]

.vscode/settings.json

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
},
6161

6262
"files.exclude": {
63-
"**/.editorconfig": true,
6463
"**/.eslintcache": true,
6564
"**/bower_components": true,
6665
"**/.turbo": true,

apps/web-antd/src/bootstrap.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createApp } from 'vue';
22

33
import '@vben/styles';
4+
import '@vben/styles/antd';
45
import { preferences } from '@vben-core/preferences';
56

67
import { loadMessages, setupI18n } from '#/locales';

internal/lint-configs/eslint-config/src/configs/perfectionist.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
2626
vue: 'vue',
2727
},
2828
value: {
29-
vben: ['@vben*', '@vben/*', '@vben-core/*'],
29+
vben: ['@vben*', '@vben/**/**', '@vben-core/**/**'],
3030
vue: ['vue', 'vue-*', '@vue*'],
3131
},
3232
},

internal/tailwind-config/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
},
3838
"./postcss": {
3939
"types": "./src/postcss.config.ts",
40+
"import": "./dist/postcss.config.mjs",
41+
"require": "./dist/postcss.config.cjs",
4042
"default": "./dist/postcss.config.mjs"
4143
},
4244
"./*": "./*"

packages/@core/shared/design-tokens/src/default/index.css

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/* https://gavin-yyc.github.io/colorconvert/ */
22
:root {
3+
--font-geist-sans: 'geist-sans', -apple-system, blinkmacsystemfont, 'Segoe UI',
4+
roboto, helvetica, arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
5+
'Segoe UI Symbol';
6+
37
/* Default background color of <body />...etc */
48
--background: 0 0 100%;
59
--foreground: 210 6% 21%;

packages/@core/shared/design/build.config.ts

-22
This file was deleted.

packages/@core/shared/design/package.json

+18-12
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,31 @@
1111
"license": "MIT",
1212
"type": "module",
1313
"scripts": {
14-
"build": "pnpm unbuild",
15-
"prepublishOnly": "npm run build",
16-
"stub": "pnpm unbuild --stub"
14+
"build": "pnpm vite build",
15+
"prepublishOnly": "npm run build"
1716
},
1817
"files": [
1918
"dist",
2019
"src"
2120
],
21+
"main": "./dist/index.mjs",
22+
"module": "./dist/index.mjs",
2223
"exports": {
23-
".": {
24-
"development": "./src/scss/index.scss",
25-
"default": "./dist/index.css"
26-
},
27-
"./tailwind": {
28-
"development": "./src/tailwind.css",
29-
"default": "./dist/tailwind.css"
24+
"./bem": {
25+
"development": "./src/scss-bem/bem.scss",
26+
"default": "./dist/bem.scss"
3027
},
31-
"./global": {
32-
"default": "./src/scss/global.scss"
28+
".": {
29+
"types": "./src/index.ts",
30+
"development": "./src/index.ts",
31+
"default": "./dist/index.mjs"
32+
}
33+
},
34+
"publishConfig": {
35+
"exports": {
36+
".": {
37+
"default": "./dist/index.mjs"
38+
}
3339
}
3440
},
3541
"dependencies": {

packages/@core/shared/design/src/index.scss

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import './scss/index.scss';
2+
import './css/tailwind.css';
3+
import './css/nprogress.css';
4+
5+
export {};

packages/@core/shared/design/src/scss/global.scss renamed to packages/@core/shared/design/src/scss-bem/bem.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@forward './common/constants.scss';
1+
@forward './constants.scss';
22

33
@mixin b($block) {
44
$B: $namespace + '-' + $block !global;

packages/@core/shared/design/src/scss/common/base.scss renamed to packages/@core/shared/design/src/scss/base.scss

-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
#app,
2-
.ant-app,
32
body,
43
html {
54
width: 100%;
65
height: 100%;
76
overscroll-behavior: none;
87
}
98

10-
.ant-app {
11-
color: inherit;
12-
}
13-
149
*,
1510
::after,
1611
::before {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/** css 样式重置 */
22
@import 'modern-normalize/modern-normalize.css';
3-
@import './common/base';
3+
@import './base';
44
@import './transition';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from '@vben/vite-config';
2+
3+
export default defineConfig({
4+
vite: {
5+
publicDir: 'src/scss-bem',
6+
},
7+
});

packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function handleMouseenter(menu: MenuRecordRaw) {
5858
</ul>
5959
</template>
6060
<style lang="scss" scoped>
61-
@import '@vben-core/design/global';
61+
@import '@vben-core/design/bem';
6262
6363
@include b('normal-menu') {
6464
--menu-item-margin-y: 4px;

packages/@core/ui-kit/menu-ui/src/styles/index.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '@vben-core/design/global';
1+
@import '@vben-core/design/bem';
22

33
.#{$namespace}-menu__popup-container,
44
.#{$namespace}-menu {

packages/@core/ui-kit/shadcn-ui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@vben-core/typings": "workspace:*",
5050
"@vueuse/core": "^10.11.0",
5151
"class-variance-authority": "^0.7.0",
52-
"lucide-vue-next": "^0.401.0",
52+
"lucide-vue-next": "^0.402.0",
5353
"radix-vue": "^1.9.0",
5454
"vue": "^3.4.31"
5555
}

packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb.vue

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import type { IBreadcrumb } from './interface';
33
44
import { IcRoundKeyboardArrowDown } from '@vben-core/iconify';
5-
65
import {
76
Breadcrumb,
87
BreadcrumbItem,

packages/@core/ui-kit/shadcn-ui/src/components/button/button.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import type { HTMLAttributes } from 'vue';
33
import { computed } from 'vue';
44
55
import { MdiLoading } from '@vben-core/iconify';
6-
import { cn } from '@vben-core/toolkit';
7-
86
import {
97
type ButtonVariants,
108
buttonVariants,
119
} from '@vben-core/shadcn-ui/components/ui/button';
10+
import { cn } from '@vben-core/toolkit';
11+
1212
import { Primitive, type PrimitiveProps } from 'radix-vue';
1313
1414
interface Props extends PrimitiveProps {

packages/@core/ui-kit/shadcn-ui/src/components/button/icon-button.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<script setup lang="ts">
22
import { type HTMLAttributes, computed, useSlots } from 'vue';
33
4-
import { cn } from '@vben-core/toolkit';
5-
64
import { VbenTooltip } from '@vben-core/shadcn-ui/components/tooltip';
75
import { ButtonVariants } from '@vben-core/shadcn-ui/components/ui/button';
6+
import { cn } from '@vben-core/toolkit';
7+
88
import { type PrimitiveProps } from 'radix-vue';
99
1010
import VbenButton from './button.vue';

packages/@core/ui-kit/shadcn-ui/src/components/checkbox/checkbox.vue

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
33
44
import { Checkbox } from '@vben-core/shadcn-ui/components/ui/checkbox';
5+
56
import { useForwardPropsEmits } from 'radix-vue';
67
78
const props = defineProps<

packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
ContextMenuShortcut,
1919
ContextMenuTrigger,
2020
} from '@vben-core/shadcn-ui/components/ui/context-menu';
21+
2122
import { useForwardPropsEmits } from 'radix-vue';
2223
2324
const props = defineProps<

packages/@core/ui-kit/shadcn-ui/src/components/hover-card/hover-card.vue

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
HoverCardContent,
99
HoverCardTrigger,
1010
} from '@vben-core/shadcn-ui/components/ui/hover-card';
11+
1112
import { HoverCardContentProps, useForwardPropsEmits } from 'radix-vue';
1213
1314
const props = defineProps<

packages/@core/ui-kit/shadcn-ui/src/components/input-password/input-password.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import {
55
IcOutlineVisibility,
66
IcOutlineVisibilityOff,
77
} from '@vben-core/iconify';
8-
98
import {
109
type InputProps,
1110
VbenInput,
1211
} from '@vben-core/shadcn-ui/components/input';
12+
1313
import { useForwardProps } from 'radix-vue';
1414
1515
import PasswordStrength from './password-strength.vue';

packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
Popover as PopoverRoot,
1313
PopoverTrigger,
1414
} from '@vben-core/shadcn-ui/components/ui/popover';
15+
1516
import { useForwardPropsEmits } from 'radix-vue';
1617
1718
const props = withDefaults(

packages/@core/ui-kit/shadcn-ui/src/components/scrollbar/scrollbar.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
import type { HTMLAttributes } from 'vue';
33
import { ref } from 'vue';
44
5-
import { cn } from '@vben-core/toolkit';
6-
75
import { ScrollArea } from '@vben-core/shadcn-ui/components/ui/scroll-area';
6+
import { cn } from '@vben-core/toolkit';
87
98
interface Props {
109
class?: HTMLAttributes['class'];

packages/@core/ui-kit/shadcn-ui/src/components/segmented/segmented.vue

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
TabsContent,
99
TabsList,
1010
} from '@vben-core/shadcn-ui/components/ui/tabs';
11+
1112
import { TabsTrigger } from 'radix-vue';
1213
1314
import TabsIndicator from './tabs-indicator.vue';

packages/@core/ui-kit/shadcn-ui/src/components/sheet/sheet.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script setup lang="ts">
22
import { computed, useSlots } from 'vue';
33
4-
import { Cross2Icon } from '@radix-icons/vue';
54
import {
65
VbenButton,
76
VbenIconButton,
@@ -18,6 +17,8 @@ import {
1817
SheetTrigger,
1918
} from '@vben-core/shadcn-ui/components/ui/sheet';
2019
20+
import { Cross2Icon } from '@radix-icons/vue';
21+
2122
interface Props {
2223
cancelText?: string;
2324
description?: string;

packages/@core/ui-kit/shadcn-ui/src/components/tooltip/tooltip.vue

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
TooltipProvider,
66
TooltipTrigger,
77
} from '@vben-core/shadcn-ui/components/ui/tooltip';
8+
89
import { TooltipContentProps } from 'radix-vue';
910
1011
interface Props {

packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogAction.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
22
import { type HTMLAttributes, computed } from 'vue';
33
4+
import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
45
import { cn } from '@vben-core/toolkit';
56
6-
import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
77
import { AlertDialogAction, type AlertDialogActionProps } from 'radix-vue';
88
99
const props = defineProps<

packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogCancel.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
22
import { type HTMLAttributes, computed } from 'vue';
33
4+
import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
45
import { cn } from '@vben-core/toolkit';
56
6-
import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
77
import { AlertDialogCancel, type AlertDialogCancelProps } from 'radix-vue';
88
99
const props = defineProps<

packages/@core/ui-kit/shadcn-ui/src/components/ui/toggle-group/ToggleGroupItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import type { VariantProps } from 'class-variance-authority';
33
44
import { type HTMLAttributes, computed, inject } from 'vue';
55
6+
import { toggleVariants } from '@vben-core/shadcn-ui/components/ui/toggle';
67
import { cn } from '@vben-core/toolkit';
78
8-
import { toggleVariants } from '@vben-core/shadcn-ui/components/ui/toggle';
99
import {
1010
ToggleGroupItem,
1111
type ToggleGroupItemProps,

packages/@core/ui-kit/tabs-ui/src/components/chrome-tabs/chrome-tabs.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '@vben-core/design/global';
1+
@import '@vben-core/design/bem';
22

33
@include b('chrome-tabs') {
44
--tabs-background: hsl(var(--background));

packages/@core/ui-kit/tabs-ui/src/components/chrome-tabs/tabs.vue

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import type { TabItem } from '@vben-core/typings';
33
4-
import type { TabsProps } from '../../interface';
4+
import type { TabsProps } from '../../types';
55
66
import { computed, nextTick, onMounted, ref, watch } from 'vue';
77
@@ -84,11 +84,7 @@ function handleUnPushPin(tab: TabItem) {
8484

8585
<template>
8686
<div :class="b()" class="relative size-full pt-1">
87-
<div
88-
ref="contentRef"
89-
:class="e('content')"
90-
class="relative h-8 overflow-hidden"
91-
>
87+
<div ref="contentRef" class="relative h-8 overflow-hidden">
9288
<TransitionGroup name="slide-down">
9389
<Tab
9490
v-for="(tab, i) in tabsView"

packages/@core/ui-kit/tabs-ui/src/tabs-view.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { TabItem } from '@vben-core/typings';
44
import { useForwardPropsEmits } from '@vben-core/shadcn-ui';
55
66
import { ChromeTabs } from './components';
7-
import { TabsProps } from './interface';
7+
import { TabsProps } from './types';
88
99
interface Props extends TabsProps {}
1010

0 commit comments

Comments
 (0)