Skip to content

Commit 06e8329

Browse files
committed
build(deps): upgrade tailwindcss to v4
1 parent 39e591a commit 06e8329

16 files changed

+370
-480
lines changed

Diff for: package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"prepare": "husky"
1515
},
1616
"dependencies": {
17+
"@tailwindcss/vite": "^4.0.0",
1718
"@vueuse/core": "^12.0.0",
1819
"counter-analytics-vue": "^1.0.0",
1920
"github-slugger": "^2.0.0",
@@ -62,13 +63,11 @@
6263
"markdown-it-link-attributes": "^4.0.1",
6364
"markdown-it-shiki": "^0.8.1",
6465
"markdown-it-toc-done-right": "^4.2.0",
65-
"postcss": "^8.4.38",
66-
"postcss-nested": "^7.0.0",
6766
"prettier": "^3.2.5",
6867
"rollup": "^4.17.2",
6968
"sass": "^1.77.0",
7069
"shiki": "^2.0.0",
71-
"tailwindcss": "^3.4.3",
70+
"tailwindcss": "^4.0.0",
7271
"ts-node": "^10.9.2",
7372
"tsx": "^4.9.3",
7473
"typescript": "^5.4.5",

Diff for: pnpm-lock.yaml

+345-452
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: postcss.config.cjs

-7
This file was deleted.

Diff for: src/assets/css/main.scss renamed to src/assets/css/main.css

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@import 'tailwindcss';
2+
@config '../../../tailwind.config.cjs';
3+
14
@import './markdown.css';
25

36
html,
@@ -20,6 +23,10 @@ html.dark {
2023
pointer-events: none;
2124
}
2225

26+
@utility bg-blue-500 {
27+
background-color: var(--color-blue-500);
28+
}
29+
2330
#nprogress .bar {
2431
@apply bg-blue-500 opacity-75;
2532

Diff for: src/components/LocaleSwitcher.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const toggleLocale = () => switchLocale(availableLocales, locale)
1515
<button
1616
:aria-label="t('button.toggle_locale')"
1717
type="button"
18-
class="w-8 h-8 p-1 ml-1 mr-1 rounded sm:ml-2"
18+
class="w-8 h-8 p-1 ml-1 mr-1 rounded-sm sm:ml-2"
1919
@click="toggleLocale"
2020
>
2121
<Icon icon="bi:translate" :width="size" :height="size" />

Diff for: src/components/MobileMenu.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ useServerHead({
1616
<div class="md:hidden">
1717
<button
1818
type="button"
19-
class="w-8 h-8 py-1 ml-1 mr-1 rounded"
19+
class="w-8 h-8 py-1 ml-1 mr-1 rounded-sm"
2020
:aria-label="t('button.toggle_mobile_menu')"
2121
@click="onToggleMobileMenu"
2222
>
@@ -33,7 +33,7 @@ useServerHead({
3333
<button
3434
type="button"
3535
aria-label="toggle modal"
36-
class="fixed w-full h-full cursor-auto focus:outline-none"
36+
class="fixed w-full h-full cursor-auto focus:outline-hidden"
3737
@click="onToggleMobileMenu"
3838
/>
3939
<nav class="fixed h-full mt-8">

Diff for: src/components/ThemeSwitcher.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const { t } = useI18n()
1414
<button
1515
:aria-label="t('button.toggle_dark')"
1616
type="button"
17-
class="w-8 h-8 p-1 ml-1 mr-1 rounded sm:ml-2"
17+
class="w-8 h-8 p-1 ml-1 mr-1 rounded-sm sm:ml-2"
1818
@click="toggleDark()"
1919
>
2020
<Icon :icon="isDark ? 'bi:moon-fill' : 'bi:sun-fill'" :width="size" :height="size" />

Diff for: src/components/Toc.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ onUnmounted(() => {
4747

4848
<template>
4949
<!-- Ported from Nextra Docs Theme with customizations -->
50-
<div class="site-toc order-last hidden flex-shrink-0 px-4 text-sm xl:block">
50+
<div class="site-toc order-last hidden shrink-0 px-4 text-sm xl:block">
5151
<div ref="tocAnchor" class="h-0 m-0 p-0" />
5252
<div
5353
ref="tocContent"

Diff for: src/components/TwBadge.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ defineProps({
4848
`dark:text-${darkTextColor}`,
4949
`text-${fontSize}`,
5050
`font-${fontWeight}`,
51-
rounded ? 'rounded' : '',
51+
rounded ? 'rounded-sm' : '',
5252
]"
5353
>
5454
<slot />

Diff for: src/components/TwDismissableBadge.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const remove = (e: Event) => emit('removed', e)
7777
`dark:text-${darkTextColor}`,
7878
`text-${fontSize}`,
7979
`font-${fontWeight}`,
80-
rounded ? 'rounded' : '',
80+
rounded ? 'rounded-sm' : '',
8181
]"
8282
>
8383
<slot />
@@ -88,7 +88,7 @@ const remove = (e: Event) => emit('removed', e)
8888
`hover:bg-${buttonHoverBackgroundColor}`,
8989
`dark:hover:bg-${buttonDarkHoverBackgroundColor}`,
9090
`text-${fontSize}`,
91-
rounded ? 'rounded' : '',
91+
rounded ? 'rounded-sm' : '',
9292
]"
9393
:data-dismiss-target="`#${computedId}`"
9494
:aria-label="t('button.remove')"

Diff for: src/main.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import type { UserModule } from './types'
55
import App from './App.vue'
66
import generatedRoutes from '~pages'
77

8-
import './tailwind.css'
9-
import './assets/css/main.scss'
8+
import './assets/css/main.css'
109

1110
const routes = setupLayouts(generatedRoutes)
1211

Diff for: src/pages/[...all].vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const { t } = useI18n()
2222
</p>
2323
<Link href="/">
2424
<button
25-
class="inline px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-blue-600 border border-transparent rounded-lg shadow focus:outline-none focus:shadow-outline-blue hover:bg-blue-700 dark:hover:bg-blue-500"
25+
class="inline px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-blue-600 border border-transparent rounded-lg shadow-sm focus:outline-hidden focus:shadow-outline-blue hover:bg-blue-700 dark:hover:bg-blue-500"
2626
>
2727
{{ t('back_to_home') }}
2828
</button>

Diff for: src/pages/categories/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const sortedCategories = computed(() => Object.keys(categories.value).sort((a, b
4040
<div v-if="Object.keys(categories).length === 0" class="mt-2 mb-2 mr-5">
4141
{{ t('no_category') }}
4242
</div>
43-
<div v-for="category in sortedCategories" :key="category" class="mt-2 mb-2 mr-2 px-2 py-1 border border-gray-500 rounded">
43+
<div v-for="category in sortedCategories" :key="category" class="mt-2 mb-2 mr-2 px-2 py-1 border border-gray-500 rounded-sm">
4444
<Category :text="category" />
4545
<Link
4646
class="-ml-2 text-sm font-semibold text-gray-600 uppercase dark:text-gray-300"

Diff for: src/pages/tags/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const sortedTags = computed(() => Object.keys(tags.value).sort((a, b) => tags.va
4040
<div v-if="Object.keys(tags).length === 0" class="mt-2 mb-2 mr-5">
4141
{{ t('no_tag') }}
4242
</div>
43-
<div v-for="tag in sortedTags" :key="tag" class="mt-2 mb-2 mr-2 px-2 py-1 border border-gray-500 rounded">
43+
<div v-for="tag in sortedTags" :key="tag" class="mt-2 mb-2 mr-2 px-2 py-1 border border-gray-500 rounded-sm">
4444
<Tag :text="tag" />
4545
<Link
4646
class="-ml-2 text-sm font-semibold text-gray-600 uppercase dark:text-gray-300"

Diff for: src/tailwind.css

-3
This file was deleted.

Diff for: vite.config.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ import Shiki from 'markdown-it-shiki'
1919
import Anchor from 'markdown-it-anchor'
2020
import VueDevTools from 'vite-plugin-vue-devtools'
2121
import generateSitemap from 'vite-ssg-sitemap'
22+
import TailwindCss from '@tailwindcss/vite'
2223
// import frontmatterToc from './src/builders/frontmatter-toc'
2324
// import excerpt from './src/builders/excerpt'
24-
import { getPostMeta } from './src/helpers/post'
25-
import siteConfig from './src/site.config'
25+
import { getPostMeta } from './src/helpers/post.js'
26+
import siteConfig from './src/site.config.js'
2627

2728
if (process.env.NODE_ENV === 'development') {
2829
dns.setDefaultResultOrder('verbatim')
@@ -259,6 +260,7 @@ export default defineConfig(({ mode }) => {
259260

260261
// https://github.com/webfansplz/vite-plugin-vue-devtools
261262
VueDevTools(),
263+
TailwindCss(),
262264
],
263265
// https://github.com/antfu/vite-ssg
264266
ssgOptions: {

0 commit comments

Comments
 (0)