From 0072fc2e00196726b2239538e75d74cfa96f57d6 Mon Sep 17 00:00:00 2001 From: bill Date: Tue, 12 Nov 2024 10:25:30 +0800 Subject: [PATCH] feat: Add background colors such as inverse-strong #3221 --- web/src/components/ui/segmented .tsx | 18 ++++++++++++++---- web/src/pages/home/header.tsx | 11 +++++++++-- web/tailwind.config.js | 18 +++++++++++++----- web/tailwind.css | 11 ++++++++++- 4 files changed, 46 insertions(+), 12 deletions(-) diff --git a/web/src/components/ui/segmented .tsx b/web/src/components/ui/segmented .tsx index bab14270247..a1d190db121 100644 --- a/web/src/components/ui/segmented .tsx +++ b/web/src/components/ui/segmented .tsx @@ -25,9 +25,19 @@ export interface SegmentedProps motionName?: string; } -export function Segmented({ options, value, onChange }: SegmentedProps) { +export function Segmented({ + options, + value, + onChange, + className, +}: SegmentedProps) { return ( -
+
{options.map((option) => { const isObject = typeof option === 'object'; const actualValue = isObject ? option.value : option; @@ -36,9 +46,9 @@ export function Segmented({ options, value, onChange }: SegmentedProps) {
onChange?.(actualValue)} > diff --git a/web/src/pages/home/header.tsx b/web/src/pages/home/header.tsx index 80a687de32e..4479c346e5d 100644 --- a/web/src/pages/home/header.tsx +++ b/web/src/pages/home/header.tsx @@ -5,6 +5,7 @@ import { Segmented, SegmentedValue } from '@/components/ui/segmented '; import { useTranslate } from '@/hooks/common-hooks'; import { useNavigateWithFromState } from '@/hooks/route-hook'; import { + ChevronDown, Cpu, Github, Library, @@ -63,7 +64,7 @@ export function HomeHeader() { }, [navigate]); return ( -
+
- + V 0.13.0 + + + CN diff --git a/web/tailwind.config.js b/web/tailwind.config.js index 861040035a6..76cdc234701 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -22,15 +22,15 @@ module.exports = { border: 'hsl(var(--border))', input: 'hsl(var(--input))', ring: 'hsl(var(--ring))', - background: 'hsl(var(--background))', + background: 'var(--background)', foreground: 'hsl(var(--foreground))', primary: { DEFAULT: 'hsl(var(--primary))', foreground: 'hsl(var(--primary-foreground))', }, secondary: { - DEFAULT: 'hsl(var(--secondary))', - foreground: 'hsl(var(--secondary-foreground))', + DEFAULT: 'var(--background-inverse-strong)', + foreground: 'var(--background-inverse-strong-foreground)', }, destructive: { DEFAULT: 'hsl(var(--destructive))', @@ -49,13 +49,21 @@ module.exports = { foreground: 'hsl(var(--popover-foreground))', }, card: { - DEFAULT: 'hsl(var(--card))', - foreground: 'hsl(var(--card-foreground))', + DEFAULT: 'var(--background-inverse-standard)', + foreground: 'var(--background-inverse-standard-foreground)', }, backgroundInverseStandard: { DEFAULT: 'var(--background-inverse-standard)', foreground: 'var(--background-inverse-standard-foreground)', }, + backgroundInverseWeak: { + DEFAULT: 'var(--background-inverse-weak)', + foreground: 'var(--background-inverse-weak-foreground)', + }, + backgroundCoreStandard: { + DEFAULT: 'var(--background-core-standard)', + foreground: 'var(--background-core-standard-foreground)', + }, }, borderRadius: { lg: `var(--radius)`, diff --git a/web/tailwind.css b/web/tailwind.css index be048d8f46c..9a45baf583a 100644 --- a/web/tailwind.css +++ b/web/tailwind.css @@ -40,7 +40,7 @@ } .dark { - --background: 224 71% 4%; + --background: rgba(11, 10, 18, 1); --foreground: 213 31% 91%; --muted: 223 47% 11%; @@ -73,6 +73,15 @@ --background-inverse-standard: rgba(230, 227, 246, 0.15); --background-inverse-standard-foreground: rgba(255, 255, 255, 1); + + --background-inverse-weak: rgba(184, 181, 203, 0.15); + --background-inverse-weak-foreground: rgba(255, 255, 255, 1); + + --background-core-standard: rgba(137, 126, 255, 1); + --background-core-standard-foreground: rgba(255, 255, 255, 1); + + --background-inverse-strong: rgba(255, 255, 255, 0.15); + --background-inverse-strong-foreground: rgba(255, 255, 255, 1); } }