部分 dropdown 迁移和其他细节修复

This commit is contained in:
lutinglt
2025-07-05 16:34:40 +08:00
parent c6d132ef0a
commit ee455ac255
11 changed files with 166 additions and 93 deletions

View File

@@ -331,6 +331,13 @@ export function defineGithubTheme(githubColor: GithubColor): Theme {
},
},
},
control: {
transparent: {
bgColor: {
hover: githubColor.control.transparent.bgColor.hover,
},
},
},
};
return defineTheme({
isDarkTheme: githubColor.isDarkTheme,

View File

@@ -1,4 +1,4 @@
import { createGlobalTheme, globalStyle } from "@vanilla-extract/css";
import { createGlobalTheme, globalKeyframes, globalStyle } from "@vanilla-extract/css";
import { otherThemeVars, themeVars } from "src/types/vars";
import type { MapLeafNodes, WithOptionalLayer } from "./types";
@@ -13,7 +13,9 @@ function stringToBoolean(str: string, name: string): boolean {
}
}
const dark_emoji = `
export const overlayAppear = "overlay-appear";
const emoji = `
.emoji[aria-label="check mark"],
.emoji[aria-label="currency exchange"],
.emoji[aria-label="TOP arrow"],
@@ -39,7 +41,7 @@ const dark_emoji = `
export function createTheme(theme: Theme): void {
const isDarkTheme = stringToBoolean(theme.isDarkTheme, "isDarkTheme");
if (isDarkTheme) {
globalStyle(dark_emoji, { filter: "invert(100%) hue-rotate(180deg)" });
globalStyle(emoji, { filter: "invert(100%) hue-rotate(180deg)" });
}
createGlobalTheme(":root", themeVars, theme);
createGlobalTheme(":root", otherThemeVars, {
@@ -57,4 +59,8 @@ export function createTheme(theme: Theme): void {
accentColor: themeVars.color.accent,
colorScheme: isDarkTheme ? "dark" : "light",
});
globalKeyframes(overlayAppear, {
"0%": { opacity: 0, transform: "translateY(-12px)" },
"100%": { opacity: 1, transform: "translateY(0)" },
});
}

View File

@@ -55,6 +55,7 @@ export const github = {
accent: {
/** 强调色
* @input `input` 输入框被选中时的边框颜色
* @clone `clone` 克隆地址框被选中时的边框颜色
* @issue `comment` 评论框被选中时的边框颜色
*/
emphasis: null,
@@ -153,4 +154,15 @@ export const github = {
},
},
},
control: {
transparent: {
bgColor: {
/** 悬停色
* @clone `clone` 克隆按钮下按钮组和面板操作列表的悬停背景颜色
* @input `inputAction` 输入框动作按钮的悬停背景颜色
*/
hover: null,
}
}
}
};