diff --git a/postcss.config.mjs b/postcss.config.mjs index cd0d6362c..ec8c02982 100644 --- a/postcss.config.mjs +++ b/postcss.config.mjs @@ -1,5 +1,6 @@ import UnoCSS from "@unocss/postcss"; +import autoprefixer from "autoprefixer"; export default { - plugins: [UnoCSS()], + plugins: [UnoCSS(), autoprefixer()], }; diff --git a/rspack.config.ts b/rspack.config.ts index 793afe542..f0fe226a7 100644 --- a/rspack.config.ts +++ b/rspack.config.ts @@ -66,20 +66,9 @@ export default defineConfig({ module: { rules: [ { - test: /\.css$/, - use: [ - { - loader: "postcss-loader", - options: { - postcssOptions: { - plugins: { - autoprefixer: {}, - }, - }, - }, - }, - ], - type: "css", + test: /\.css$/i, + type: "css/auto", + use: ["postcss-loader"], }, { test: /\.(svg|png)$/, diff --git a/src/index.css b/src/index.css index b183908e9..6eb4944b4 100644 --- a/src/index.css +++ b/src/index.css @@ -1,5 +1,6 @@ @unocss preflights; @unocss default; +@unocss; body { scrollbar-color: var(--color-scrollbar-thumb) var(--color-scrollbar-track); @@ -17,4 +18,19 @@ body[arco-theme='light'] { --color-scrollbar-thumb: #6b6b6b; --color-scrollbar-track: #f0f0f0; --color-scrollbar-thumb-hover: #8c8c8c; -} \ No newline at end of file +} + +:root { + --sc-zero-1: 0; + --sc-zero-2: 0; + --sc-zero-3: 0; + --sc-zero-4: 0; +} + +/* 自定义 .sc-inset-0 避免打包成 inset: 0 使旧浏览器布局错位 */ +.sc-inset-0 { + top: var(--sc-zero-1); + left: var(--sc-zero-2); + right: var(--sc-zero-3); + bottom: var(--sc-zero-4); +} diff --git a/src/pages/batchupdate/App.tsx b/src/pages/batchupdate/App.tsx index 3fb0fa7b6..6bc55872f 100644 --- a/src/pages/batchupdate/App.tsx +++ b/src/pages/batchupdate/App.tsx @@ -256,7 +256,7 @@ function App() { title={ openUpdatePage(item.uuid)} - className="text-clickable text-gray-900 dark:text-gray-100 !hover:text-blue-600 dark:hover:text-blue-400" + className="tw-text-clickable tw-text-gray-900 dark:tw-text-gray-100 !hover:tw-text-blue-600 dark:hover:tw-text-blue-400" > {item.script?.name} @@ -285,7 +285,7 @@ function App() { } > - + {t("updatepage.old_version_")} {t("updatepage.new_version_")} @@ -377,31 +377,31 @@ function App() { return ( <> { -
-
- +
+
+ {t("updatepage.main_header")} onCheckUpdateClick()} - className="cursor-pointer text-gray-700 dark:text-gray-300" + className="tw-cursor-pointer tw-text-gray-700 dark:tw-text-gray-300" />
-
- {mStatusText} +
+ {mStatusText}
{mRecords === null ? ( <> ) : ( <> {mRecords.site.length === 0 && mRecords.other.length === 0 ? ( -
- {t("updatepage.status_no_update")} +
+ {t("updatepage.status_no_update")}
) : ( -
- +
+ {t("updatepage.status_n_update").replace("$0", `${mRecords.site.length + mRecords.other.length}`)}
@@ -410,15 +410,15 @@ function App() { //
{"没有已忽略的更新"}
<> ) : ( -
- +
+ {t("updatepage.status_n_ignored").replace("$0", `${mRecords.ignored.length}`)}
)} {mTimeClose >= 0 ? ( -
- +
+ {t("updatepage.status_autoclose").replace("$0", `${mTimeClose}`)}
@@ -439,9 +439,9 @@ function App() { - + diff --git a/src/pages/components/ScriptMenuList/index.tsx b/src/pages/components/ScriptMenuList/index.tsx index d29c8756f..fc4d6a09f 100644 --- a/src/pages/components/ScriptMenuList/index.tsx +++ b/src/pages/components/ScriptMenuList/index.tsx @@ -89,7 +89,7 @@ const MenuItem = React.memo(({ menuItems, uuid }: MenuItemProps) => { }} > )} {url && isEffective !== null && (
-
+
{/* 依数量与展开状态决定要显示的分组项(收合时只显示前 menuExpandNum 笔) */} {visibleMenus.map(({ uuid, groupKey, menus }) => { // 不同脚本之间可能出现相同的 groupKey;为避免 React key 冲突,需加上 uuid 做区分。 @@ -278,7 +278,7 @@ const ListMenuItem = React.memo( })} {shouldShowMore && (