Skip to content

Commit 303a54c

Browse files
committed
feat(docs): migrate to tailwindCSS v4
1 parent 3a72a2b commit 303a54c

File tree

4 files changed

+89
-90
lines changed

4 files changed

+89
-90
lines changed

docs/.vitepress/config.ts

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,88 @@
1-
import { defineConfig } from 'vitepress'
2-
import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons'
3-
import { componentViewMarkdownPlugin } from 'vitepress-plugin-vue-component-view'
1+
import { defineConfig } from "vitepress";
2+
import {
3+
groupIconMdPlugin,
4+
groupIconVitePlugin,
5+
} from "vitepress-plugin-group-icons";
6+
import { componentViewMarkdownPlugin } from "vitepress-plugin-vue-component-view";
7+
import tailwindcss from "@tailwindcss/vite";
48

59
// https://vitepress.dev/reference/site-config
610
export default defineConfig({
7-
title: 'NextUI Vue',
8-
description: 'Vue 3 Component Library based on HeroUI Theme',
9-
head: [['link', { rel: 'icon', href: '/logo.png' }]],
11+
title: "NextUI Vue",
12+
description: "Vue 3 Component Library based on HeroUI Theme",
13+
head: [["link", { rel: "icon", href: "/logo.png" }]],
1014
ignoreDeadLinks: true,
1115

1216
markdown: {
1317
config(md) {
14-
md.use(groupIconMdPlugin)
15-
md.use(componentViewMarkdownPlugin)
18+
md.use(groupIconMdPlugin);
19+
md.use(componentViewMarkdownPlugin);
1620
},
1721
},
1822
vite: {
19-
plugins: [
20-
groupIconVitePlugin(),
21-
],
23+
plugins: [groupIconVitePlugin(), tailwindcss()],
2224
},
2325

2426
locales: {
2527
root: {
26-
label: 'English',
27-
lang: 'en',
28+
label: "English",
29+
lang: "en",
2830
link: "/en/",
29-
title: 'NextUI Vue',
30-
description: 'Vue 3 Component Library based on HeroUI Theme',
31+
title: "NextUI Vue",
32+
description: "Vue 3 Component Library based on HeroUI Theme",
3133
themeConfig: {
3234
nav: [
33-
{ text: 'Guide', link: '/en/guide/introduction' },
34-
{ text: 'Components', link: '/en/components/button' },
35-
{ text: 'HeroUI', link: 'https://heroui.com/' },
35+
{ text: "Guide", link: "/en/guide/introduction" },
36+
{ text: "Components", link: "/en/components/button" },
37+
{ text: "HeroUI", link: "https://heroui.com/" },
3638
],
3739
sidebar: [
3840
{
39-
text: 'Guide',
41+
text: "Guide",
4042
collapsed: false,
4143
items: [
42-
{ text: 'Introduction', link: '/en/guide/introduction' },
43-
{ text: 'Installation', link: '/en/guide/installation' },
44+
{ text: "Introduction", link: "/en/guide/introduction" },
45+
{ text: "Installation", link: "/en/guide/installation" },
4446
],
4547
},
4648
{
47-
text: 'Components',
49+
text: "Components",
4850
collapsed: false,
4951
items: [
50-
{ text: 'Button', link: '/en/components/button' },
51-
{ text: 'Alert', link: '/en/components/alert' },
52+
{ text: "Button", link: "/en/components/button" },
53+
{ text: "Alert", link: "/en/components/alert" },
5254
],
5355
},
5456
],
5557
},
5658
},
5759
zh: {
58-
label: '简体中文',
60+
label: "简体中文",
5961
link: "/zh/",
60-
lang: 'zh-CN',
61-
title: 'NextUI Vue',
62-
description: '基于HeroUI Theme构建的Vue3组件库',
62+
lang: "zh-CN",
63+
title: "NextUI Vue",
64+
description: "基于HeroUI Theme构建的Vue3组件库",
6365
themeConfig: {
6466
nav: [
65-
{ text: '指南', link: '/zh/guide/introduction' },
66-
{ text: '组件', link: '/zh/components/button' },
67-
{ text: 'HeroUI', link: 'https://heroui.com/' },
67+
{ text: "指南", link: "/zh/guide/introduction" },
68+
{ text: "组件", link: "/zh/components/button" },
69+
{ text: "HeroUI", link: "https://heroui.com/" },
6870
],
6971
sidebar: [
7072
{
71-
text: '指南',
73+
text: "指南",
7274
collapsed: false,
7375
items: [
74-
{ text: '介绍', link: '/zh/guide/introduction' },
75-
{ text: '安装', link: '/zh/guide/installation' },
76+
{ text: "介绍", link: "/zh/guide/introduction" },
77+
{ text: "安装", link: "/zh/guide/installation" },
7678
],
7779
},
7880
{
79-
text: '组件',
81+
text: "组件",
8082
collapsed: false,
8183
items: [
82-
{ text: 'Button', link: '/zh/components/button' },
83-
{ text: 'Alert', link: '/zh/components/alert' },
84+
{ text: "Button", link: "/zh/components/button" },
85+
{ text: "Alert", link: "/zh/components/alert" },
8486
],
8587
},
8688
],
@@ -89,27 +91,27 @@ export default defineConfig({
8991
},
9092

9193
themeConfig: {
92-
logo: '/logo.png',
94+
logo: "/logo.png",
9395
search: {
94-
provider: 'local',
96+
provider: "local",
9597
},
96-
outline: 'deep',
98+
outline: "deep",
9799

98100
socialLinks: [
99-
{ icon: 'github', link: 'https://github.com/nextui-vue/nextui-vue' },
101+
{ icon: "github", link: "https://github.com/nextui-vue/nextui-vue" },
100102
],
101103

102104
footer: {
103-
message: 'MIT Licensed',
104-
copyright: '©hotdogc1017',
105+
message: "MIT Licensed",
106+
copyright: "©hotdogc1017",
105107
},
106108

107109
// Language switcher
108-
langMenuLabel: 'Change language',
109-
returnToTopLabel: 'Return to top',
110-
sidebarMenuLabel: 'Menu',
111-
darkModeSwitchLabel: 'Dark mode',
112-
lightModeSwitchTitle: 'Switch to light theme',
113-
darkModeSwitchTitle: 'Switch to dark theme',
110+
langMenuLabel: "Change language",
111+
returnToTopLabel: "Return to top",
112+
sidebarMenuLabel: "Menu",
113+
darkModeSwitchLabel: "Dark mode",
114+
lightModeSwitchTitle: "Switch to light theme",
115+
darkModeSwitchTitle: "Switch to dark theme",
114116
},
115-
})
117+
});

docs/.vitepress/theme/styles.css

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import "tailwindcss";
2+
@config "../../tailwind.config.js";
3+
44
:root {
5-
--primary-color: #73D552;
6-
--primary-color-1: #91e274;
7-
--primary-color-2: #bbefa7;
8-
--primary-color-3: #dcf7d0;
9-
--vp-home-hero-name-color: transparent;
10-
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, var(--primary-color) 40%, var(--primary-color-1));
11-
12-
/* --vp-home-hero-image-background-image: linear-gradient(-45deg, #cd8025 50%, #eccd90 50%); */
13-
--vp-home-hero-image-background-image: linear-gradient(
14-
-45deg,
15-
var(--primary-color) 50%,
16-
var(--primary-color-1) 50%
17-
);
18-
--vp-home-hero-image-filter: blur(80px);
19-
}
5+
--primary-color: #73d552;
6+
--primary-color-1: #91e274;
7+
--primary-color-2: #bbefa7;
8+
--primary-color-3: #dcf7d0;
9+
--vp-home-hero-name-color: transparent;
10+
--vp-home-hero-name-background: -webkit-linear-gradient(
11+
120deg,
12+
var(--primary-color) 40%,
13+
var(--primary-color-1)
14+
);
15+
16+
/* --vp-home-hero-image-background-image: linear-gradient(-45deg, #cd8025 50%, #eccd90 50%); */
17+
--vp-home-hero-image-background-image: linear-gradient(
18+
-45deg,
19+
var(--primary-color) 50%,
20+
var(--primary-color-1) 50%
21+
);
22+
--vp-home-hero-image-filter: blur(80px);
23+
}
2024

21-
/**
25+
/**
2226
* 颜色
2327
*/
24-
:root {
25-
--vp-c-brand-1: var(--primary-color);
26-
--vp-c-brand-2: var(--primary-color-1);
27-
--vp-c-brand-3: var(--primary-color);
28-
--vp-c-brand-soft: var(--vp-c-indigo-soft);
29-
}
28+
:root {
29+
--vp-c-brand-1: var(--primary-color);
30+
--vp-c-brand-2: var(--primary-color-1);
31+
--vp-c-brand-3: var(--primary-color);
32+
--vp-c-brand-soft: var(--vp-c-indigo-soft);
33+
}
3034

31-
.dark {
32-
--vp-c-brand-1: var(--primary-color);
33-
--vp-c-brand-2: var(--primary-color-1);
34-
--vp-c-brand-3: var(--primary-color);
35-
--vp-c-brand-soft: var(--vp-c-indigo-soft);
36-
}
35+
.dark {
36+
--vp-c-brand-1: var(--primary-color);
37+
--vp-c-brand-2: var(--primary-color-1);
38+
--vp-c-brand-3: var(--primary-color);
39+
--vp-c-brand-soft: var(--vp-c-indigo-soft);
40+
}

docs/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
},
1111
"devDependencies": {
1212
"@heroui/theme": "^2.4.11",
13-
"autoprefixer": "^10.4.21",
13+
"@tailwindcss/vite": "^4.1.11",
1414
"nextui-vue": "workspace: *",
15-
"postcss": "^8.5.3",
16-
"tailwindcss": "^3.4.17",
15+
"tailwindcss": "^4",
1716
"vitepress": "^1.3.1",
1817
"vitepress-plugin-group-icons": "^1.3.7",
1918
"vitepress-plugin-vue-component-view": "latest"

docs/postcss.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)