refactor: complete border unification across all components

- Add border styles to JsonEditor (CodeMirror) with theme-responsive colors
- Update all dialog header/footer dividers to use border-border-default
- Replace remaining border-border instances in settings components
- Ensure all borders (including separators and container borders) use unified design system
- All borders now consistently use CSS variables and respond to light/dark themes
This commit is contained in:
Jason
2025-10-21 10:07:03 +08:00
parent 3626880663
commit cbd1903b90
7 changed files with 16 additions and 8 deletions

View File

@@ -86,6 +86,14 @@ const JsonEditor: React.FC<JsonEditorProps> = ({
"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace", "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
fontSize: "14px", fontSize: "14px",
}, },
".cm-editor": {
border: "1px solid hsl(var(--border))",
borderRadius: "0.5rem",
},
".cm-editor.cm-focused": {
outline: "none",
borderColor: "hsl(var(--primary))",
},
}); });
const extensions = [ const extensions = [

View File

@@ -140,7 +140,7 @@ export function AboutSection({ isPortable }: AboutSectionProps) {
</p> </p>
</header> </header>
<div className="space-y-4 rounded-lg border border-border p-4"> <div className="space-y-4 rounded-lg border border-border-default p-4">
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"> <div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div className="space-y-1"> <div className="space-y-1">
<p className="text-sm font-medium text-foreground">CC Switch</p> <p className="text-sm font-medium text-foreground">CC Switch</p>

View File

@@ -51,7 +51,7 @@ export function ImportExportSection({
</p> </p>
</header> </header>
<div className="space-y-3 rounded-lg border border-border p-4"> <div className="space-y-3 rounded-lg border border-border-default p-4">
<Button <Button
type="button" type="button"
className="w-full" className="w-full"
@@ -138,7 +138,7 @@ function ImportStatusMessage({
if (status === "importing") { if (status === "importing") {
return ( return (
<div className={`${baseClass} border-border bg-muted/40`}> <div className={`${baseClass} border-border-default bg-muted/40`}>
<Loader2 className="mt-0.5 h-4 w-4 animate-spin text-muted-foreground" /> <Loader2 className="mt-0.5 h-4 w-4 animate-spin text-muted-foreground" />
<div> <div>
<p className="font-medium">{t("settings.importing")}</p> <p className="font-medium">{t("settings.importing")}</p>

View File

@@ -18,7 +18,7 @@ export function LanguageSettings({ value, onChange }: LanguageSettingsProps) {
{t("settings.languageHint")} {t("settings.languageHint")}
</p> </p>
</header> </header>
<div className="inline-flex gap-1 rounded-md border border-border bg-background p-1"> <div className="inline-flex gap-1 rounded-md border border-border-default bg-background p-1">
<LanguageButton active={value === "zh"} onClick={() => onChange("zh")}> <LanguageButton active={value === "zh"} onClick={() => onChange("zh")}>
{t("settings.languageOptionChinese")} {t("settings.languageOptionChinese")}
</LanguageButton> </LanguageButton>

View File

@@ -16,7 +16,7 @@ export function ThemeSettings() {
{t("settings.themeHint")} {t("settings.themeHint")}
</p> </p>
</header> </header>
<div className="inline-flex gap-1 rounded-md border border-border bg-background p-1"> <div className="inline-flex gap-1 rounded-md border border-border-default bg-background p-1">
<ThemeButton <ThemeButton
active={theme === "light"} active={theme === "light"}
onClick={() => setTheme("light")} onClick={() => setTheme("light")}

View File

@@ -52,7 +52,7 @@ function ToggleRow({
onCheckedChange, onCheckedChange,
}: ToggleRowProps) { }: ToggleRowProps) {
return ( return (
<div className="flex items-start justify-between gap-4 rounded-lg border border-border p-4"> <div className="flex items-start justify-between gap-4 rounded-lg border border-border-default p-4">
<div className="space-y-1"> <div className="space-y-1">
<p className="text-sm font-medium leading-none">{title}</p> <p className="text-sm font-medium leading-none">{title}</p>
{description ? ( {description ? (

View File

@@ -78,7 +78,7 @@ const DialogHeader = ({
}: React.HTMLAttributes<HTMLDivElement>) => ( }: React.HTMLAttributes<HTMLDivElement>) => (
<div <div
className={cn( className={cn(
"flex flex-col space-y-1.5 text-center sm:text-left px-6 py-5 border-b border-border bg-muted/20 flex-shrink-0", "flex flex-col space-y-1.5 text-center sm:text-left px-6 py-5 border-b border-border-default bg-muted/20 flex-shrink-0",
className, className,
)} )}
{...props} {...props}
@@ -92,7 +92,7 @@ const DialogFooter = ({
}: React.HTMLAttributes<HTMLDivElement>) => ( }: React.HTMLAttributes<HTMLDivElement>) => (
<div <div
className={cn( className={cn(
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:items-center px-6 py-5 border-t border-border bg-muted/20 flex-shrink-0", "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:items-center px-6 py-5 border-t border-border-default bg-muted/20 flex-shrink-0",
className, className,
)} )}
{...props} {...props}