Skip to content

Commit 857fc79

Browse files
committed
chore: replace iconify plugin
Signed-off-by: Innei <[email protected]>
1 parent 51c3655 commit 857fc79

File tree

75 files changed

+229
-218
lines changed

Some content is hidden

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

75 files changed

+229
-218
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@
116116
"xss": "1.0.15"
117117
},
118118
"devDependencies": {
119+
"@egoist/tailwindcss-icons": "1.8.1",
119120
"@iconify-json/material-symbols": "1.2.1",
120121
"@iconify-json/mingcute": "1.2.0",
121-
"@iconify/tailwind": "1.1.3",
122122
"@innei/prettier": "0.15.0",
123123
"@mx-space/webhook": "0.5.0",
124124
"@next/bundle-analyzer": "14.2.13",

plugins/tw-css-plugin.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// https://github.com/tailwindlabs/tailwindcss-intellisense/issues/227#issuecomment-1462034856
2+
// cssAsPlugin.js
3+
const postcss = require('postcss')
4+
const postcssJs = require('postcss-js')
5+
const { readFileSync } = require('node:fs')
6+
7+
require.extensions['.css'] = function (module, filename) {
8+
const cssAsPlugin = ({ addBase, addComponents, addUtilities }) => {
9+
const css = readFileSync(filename, 'utf8')
10+
const root = postcss.parse(css)
11+
const jss = postcssJs.objectify(root)
12+
13+
if ('@layer base' in jss) {
14+
addBase(jss['@layer base'])
15+
}
16+
if ('@layer components' in jss) {
17+
addComponents(jss['@layer components'])
18+
}
19+
if ('@layer utilities' in jss) {
20+
addUtilities(jss['@layer utilities'])
21+
}
22+
}
23+
module.exports = cssAsPlugin
24+
}

pnpm-lock.yaml

Lines changed: 15 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/(app)/(home)/components/ActivityCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const ActivityCard = ({ activity }: { activity: ReactActivityType }) => {
5252
iconClassName,
5353
)}
5454
>
55-
<i className="icon-[mingcute--comment-line]" />
55+
<i className="i-mingcute-comment-line" />
5656
</div>
5757
<div className="flex items-center gap-2 pl-8">
5858
<div className="space-x-2">
@@ -175,7 +175,7 @@ export const ActivityCard = ({ activity }: { activity: ReactActivityType }) => {
175175
return (
176176
<div className="flex translate-y-1/4 items-start gap-2">
177177
<span className={clsx(iconClassName)}>
178-
<i className="icon-[mingcute--heart-line]" />
178+
<i className="i-mingcute-heart-line" />
179179
</span>
180180
<div className="space-x-2">
181181
<small>有人点赞了</small> {TitleLink}

src/app/(app)/(home)/components/ActivityPostList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const ActivityPostList = () => {
5252
className="flex items-center justify-end opacity-70 duration-200 hover:text-accent"
5353
href={routeBuilder(Routes.Posts, {})}
5454
>
55-
<i className="icon-[mingcute--arrow-right-circle-line]" />
55+
<i className="i-mingcute-arrow-right-circle-line" />
5656
<span className="ml-2">还有更多</span>
5757
</Link>
5858

@@ -85,7 +85,7 @@ export const ActivityPostList = () => {
8585
className="flex items-center justify-end opacity-70 duration-200 hover:text-accent"
8686
href={routeBuilder(Routes.Timelime, { type: 'note' })}
8787
>
88-
<i className="icon-[mingcute--arrow-right-circle-line]" />
88+
<i className="i-mingcute-arrow-right-circle-line" />
8989
<span className="ml-2">还有更多</span>
9090
</Link>
9191
</m.section>

src/app/(app)/(home)/page.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const Hero = () => {
142142
<span className="opacity-80">{description}</span>
143143
</BottomToUpTransitionView>
144144

145-
<ul className="mx-[60px] mt-8 flex flex-wrap gap-6 center lg:mx-auto lg:mt-28 lg:justify-start lg:gap-4">
145+
<ul className="center mx-[60px] mt-8 flex flex-wrap gap-6 lg:mx-auto lg:mt-28 lg:justify-start lg:gap-4">
146146
{Object.entries(socialIds || noopObj).map(
147147
([type, id]: any, index) => {
148148
if (!isSupportIcon(type)) return null
@@ -181,16 +181,16 @@ const Hero = () => {
181181
animate={{ opacity: 1, y: 0 }}
182182
transition={softBouncePreset}
183183
className={clsx(
184-
'inset-x-0 bottom-0 mt-12 flex flex-col center lg:absolute lg:mt-0',
184+
'center inset-x-0 bottom-0 mt-12 flex flex-col lg:absolute lg:mt-0',
185185

186-
'text-neutral-800/80 center dark:text-neutral-200/80',
186+
'center text-neutral-800/80 dark:text-neutral-200/80',
187187
)}
188188
>
189189
<small className="text-center">
190190
当第一颗卫星飞向大气层外,我们便以为自己终有一日会征服宇宙。
191191
</small>
192192
<span className="mt-8 animate-bounce">
193-
<i className="icon-[mingcute--right-line] rotate-90 text-2xl" />
193+
<i className="i-mingcute-right-line rotate-90 text-2xl" />
194194
</span>
195195
</m.div>
196196
</TwoColumnLayout>
@@ -273,7 +273,7 @@ const Windsock = () => {
273273
const { present: presentSubscribe } = usePresentSubscribeModal()
274274
return (
275275
<>
276-
<div className="mt-28 flex flex-col center">
276+
<div className="center mt-28 flex flex-col">
277277
<div className="my-5 text-2xl font-medium">风向标</div>
278278
<div className="mb-24 opacity-90">去到别去看看?</div>
279279
<ul className="flex flex-col flex-wrap gap-2 gap-y-8 opacity-80 lg:flex-row">
@@ -325,7 +325,7 @@ const Windsock = () => {
325325

326326
<div className="mt-24 flex justify-center gap-4">
327327
<StyledButton
328-
className="flex gap-2 bg-red-400 center"
328+
className="center flex gap-2 bg-red-400"
329329
onClick={() => {
330330
apiClient
331331
.proxy('like_this')
@@ -339,7 +339,7 @@ const Windsock = () => {
339339
toast('谢谢你!', undefined, {
340340
iconElement: (
341341
<m.i
342-
className="icon-[mingcute--heart-fill] text-uk-red-light"
342+
className="i-mingcute-heart-fill text-uk-red-light"
343343
initial={{
344344
scale: 0.96,
345345
}}
@@ -357,20 +357,20 @@ const Windsock = () => {
357357
})
358358
}}
359359
>
360-
喜欢本站 <i className="icon-[mingcute--heart-fill]" />{' '}
360+
喜欢本站 <i className="i-mingcute-heart-fill" />{' '}
361361
<NumberSmoothTransition>
362362
{count as any as string}
363363
</NumberSmoothTransition>
364364
</StyledButton>
365365

366366
<StyledButton
367-
className="flex gap-2 center"
367+
className="center flex gap-2"
368368
onClick={() => {
369369
presentSubscribe()
370370
}}
371371
>
372372
订阅
373-
<i className="icon-[material-symbols--notifications-active]" />
373+
<i className="i-material-symbols-notifications-active" />
374374
</StyledButton>
375375
</div>
376376
</>

src/app/(app)/(note-topic)/notes/(topic-detail)/topics/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default function Page() {
7575
>
7676
{child.title}
7777
</Link>
78-
<span className="meta">
78+
<span>
7979
{(date.getMonth() + 1).toString().padStart(2, '0')}/
8080
{date.getDate().toString().padStart(2, '0')}/
8181
{date.getFullYear()}

src/app/(app)/(note-topic)/notes/topics/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default definePrerenderPage()({
3939
>
4040
{item.name}
4141
</Link>
42-
<span className="meta">
42+
<span>
4343
{(date.getMonth() + 1).toString().padStart(2, '0')}/
4444
{date.getDate().toString().padStart(2, '0')}/
4545
{date.getFullYear()}

src/app/(app)/thinking/page.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const PostBox = () => {
9999
handleSend()
100100
}}
101101
>
102-
<div className="absolute bottom-2 right-2 flex size-5 center">
102+
<div className="center absolute bottom-2 right-2 flex size-5">
103103
<MotionButtonBase
104104
onClick={() => handleSend()}
105105
disabled={value.length === 0 || isPending}
@@ -250,7 +250,7 @@ const List = () => {
250250
<div
251251
className={clsx(
252252
'mt-4 space-x-8 opacity-50 duration-200 hover:opacity-100',
253-
'[&_button:hover]:text-accent [&_button]:inline-flex [&_button]:space-x-1 [&_button]:text-sm [&_button]:center',
253+
'[&_button]:center [&_button:hover]:text-accent [&_button]:inline-flex [&_button]:space-x-1 [&_button]:text-sm',
254254
'[&_button]:-my-5 [&_button]:-ml-5 [&_button]:p-5',
255255
)}
256256
>
@@ -262,7 +262,7 @@ const List = () => {
262262
})
263263
}}
264264
>
265-
<i className="icon-[mingcute--comment-line]" />
265+
<i className="i-mingcute-comment-line" />
266266

267267
<span className="sr-only">评论</span>
268268
<span>
@@ -276,7 +276,7 @@ const List = () => {
276276
handleUp(item.id)
277277
}}
278278
>
279-
<i className="icon-[mingcute--heart-line]" />
279+
<i className="i-mingcute-heart-line" />
280280
<span className="sr-only">喜欢</span>
281281
<span>{item.up}</span>
282282
</button>
@@ -286,7 +286,7 @@ const List = () => {
286286
handleDown(item.id)
287287
}}
288288
>
289-
<i className="icon-[mingcute--heart-crack-line]" />
289+
<i className="i-mingcute-heart-crack-line" />
290290
<span className="sr-only">不喜欢</span>
291291
<span>{item.down}</span>
292292
</button>
@@ -368,7 +368,7 @@ const DeleteButton = (props: { id: string }) => {
368368
})
369369
}}
370370
>
371-
<i className="icon-[mingcute--delete-line]" />
371+
<i className="i-mingcute-delete-line" />
372372
<span className="sr-only">删除</span>
373373
</button>
374374
)
@@ -407,7 +407,7 @@ const RefPreview: FC<{ refModel: any }> = (props) => {
407407
<>
408408
<Divider className="my-4 w-12 bg-current opacity-50" />
409409
<p className="flex items-center space-x-2 opacity-80">
410-
发表于: <i className="icon-[mingcute--link-3-line]" />
410+
发表于: <i className="i-mingcute-link-3-line" />
411411
<PeekLink href={url} className="shiro-link--underline">
412412
{title}
413413
</PeekLink>

src/app/(dashboard)/dashboard/notes/list/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default (function Page() {
7171
}}
7272
className="card-shadow"
7373
>
74-
<i className="icon-[mingcute--add-line] text-white" />
74+
<i className="i-mingcute-add-line text-white" />
7575
</RoundedIconButton>
7676
</OffsetHeaderLayout>
7777
</div>

0 commit comments

Comments
 (0)