From f12c471b1e69c4fd0b0931c19138b34ef84e0d0c Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:02:44 -0700 Subject: [PATCH 01/28] deprecate: inverted token --- src/@chakra-ui/semanticTokens.ts | 2 -- src/@chakra-ui/stories/Colors.stories.tsx | 2 +- tailwind.config.ts | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/@chakra-ui/semanticTokens.ts b/src/@chakra-ui/semanticTokens.ts index 7d3a68a0a18..974c08bb1d9 100644 --- a/src/@chakra-ui/semanticTokens.ts +++ b/src/@chakra-ui/semanticTokens.ts @@ -55,8 +55,6 @@ const semanticTokens = { base: { _light: "gray.800", _dark: "gray.100" }, medium: { _light: "gray.500", _dark: "gray.400" }, light: { _light: "gray.200", _dark: "gray.600" }, - // ! Deprecating body.inverted - inverted: { _light: "gray.100", _dark: "gray.800" }, }, background: { base: { _light: "white", _dark: "gray.950" }, diff --git a/src/@chakra-ui/stories/Colors.stories.tsx b/src/@chakra-ui/stories/Colors.stories.tsx index bfefcbe5ac7..ddaf32ef76d 100644 --- a/src/@chakra-ui/stories/Colors.stories.tsx +++ b/src/@chakra-ui/stories/Colors.stories.tsx @@ -113,7 +113,7 @@ export const SemanticScheme: StoryObj = { ] as const const deprecatedTokens: Record<(typeof tokenNames)[number], string[]> = { primary: ["light", "dark", "pressed"], - body: ["inverted"], + body: [], background: [], disabled: [], success: ["neutral", "outline"], diff --git a/tailwind.config.ts b/tailwind.config.ts index 9e0bb7b8948..8c7873bf93e 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -145,6 +145,7 @@ const config = { DEFAULT: "hsla(var(--body))", medium: "hsla(var(--body-medium))", light: "hsla(var(--body-light))", + inverse: "hsla(var(--body-inverse))", }, background: { DEFAULT: "hsla(var(--background))", From 9313c222a928d3025b46103991f015ebed7c2b28 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:13:44 -0700 Subject: [PATCH 02/28] theme: update gray palette with lum margin each lum percentage correlates to a small range of hex codes that all round to the lum value in Figma, shows range in comments for rough equivalency --- src/styles/colors.css | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/styles/colors.css b/src/styles/colors.css index 46942217230..2891d05df55 100644 --- a/src/styles/colors.css +++ b/src/styles/colors.css @@ -4,19 +4,19 @@ @layer base { :root { - --white: 0, 0%, 100%; /* #ffffff */ - --gray-50: 0, 0%, 97%; /* #f7f7f7 */ - --gray-100: 0, 0%, 93%; /* #eeeeee */ - --gray-150: 0, 0%, 93%; /* #ececec */ /* TODO: Confirm this shade, used in nav menu */ - --gray-200: 0, 0%, 81%; /*#cecece */ - --gray-300: 0, 0%, 67%; /* #acacac */ - --gray-400: 0, 0%, 55%; /* #8C8C8C */ - --gray-500: 0, 0%, 38%; /* #616161 */ - --gray-600: 0, 0%, 20%; /* #333333 */ - --gray-700: 0, 0%, 13%; /* #222222 */ - --gray-800: 0, 0%, 11%; /* #1b1b1b */ - --gray-900: 0, 0%, 7%; /* #121212 */ - --gray-950: 0, 0%, 4%; /* #0a0a0a */ + --white: 0, 0%, 100%; /* #FFFFFF */ + --gray-50: 0, 0%, 97%; /* #F7F7F7 +1 */ + --gray-100: 0, 0%, 93%; /* #EDEDED ±1 */ /* TODO: Confirm */ + --gray-150: 0, 0%, 87%; /* #DEDEDE ±1 */ /* TODO: Confirm */ + --gray-200: 0, 0%, 81%; /* #CECECE +1 */ + --gray-300: 0, 0%, 67%; /* #ABABAB ±1 */ + --gray-400: 0, 0%, 55%; /* #8C8C8C ±1 */ + --gray-500: 0, 0%, 38%; /* #616161 ±1 */ + --gray-600: 0, 0%, 20%; /* #333333 ±1 */ + --gray-700: 0, 0%, 13%; /* #222222 -2 */ + --gray-800: 0, 0%, 11%; /* #1B1B1B +2 */ + --gray-900: 0, 0%, 7%; /* #121212 ±1 */ + --gray-950: 0, 0%, 4%; /* #0A0A0A ±1 */ --black: 0, 0%, 0%; /* #000000 */ --purple-50: 262, 100%, 96%; /* #F3ECFF */ @@ -82,6 +82,5 @@ --green-900: 140, 37%, 6%; /* #0a160e */ --yellow-200: 47, 100%, 94%; /* #fff8df */ --yellow-500: 42, 100%, 37%; /* #bd8400 */ - } } From 4f7b6e61b8819416b11712bfbb68c709406aec29 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:14:16 -0700 Subject: [PATCH 03/28] fix: contrast with lang picker menu selected bg --- src/components/ui/command.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ui/command.tsx b/src/components/ui/command.tsx index df1325e4c94..426ce68958b 100644 --- a/src/components/ui/command.tsx +++ b/src/components/ui/command.tsx @@ -136,7 +136,7 @@ const CommandItem = React.forwardRef< Date: Fri, 6 Sep 2024 17:20:24 -0700 Subject: [PATCH 04/28] fix: progress bar component and colors for quizzes --- src/components/Quiz/QuizzesStats.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Quiz/QuizzesStats.tsx b/src/components/Quiz/QuizzesStats.tsx index f016a822bad..0b77a3a02c0 100644 --- a/src/components/Quiz/QuizzesStats.tsx +++ b/src/components/Quiz/QuizzesStats.tsx @@ -9,7 +9,6 @@ import { Highlight, HStack, ListItem, - Progress, SimpleGrid, Stack, Text, @@ -24,6 +23,7 @@ import { ethereumBasicsQuizzes, usingEthereumQuizzes } from "../../data/quizzes" import { Button } from "../Buttons" import { TrophyIcon } from "../icons/quiz" import Translation from "../Translation" +import { Progress } from "../ui/progress" import { getFormattedStats, @@ -131,6 +131,7 @@ const QuizzesStats = ({ From 128a41db5d469b6fa3ab9b94552daafa1227d165 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Sat, 7 Sep 2024 15:24:25 -0700 Subject: [PATCH 05/28] chore: update button-hover color to DS --- tailwind.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tailwind.config.ts b/tailwind.config.ts index 8c7873bf93e..9a1edf1cb1e 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -203,7 +203,7 @@ const config = { 0px -3px 2px 0px rgba(0, 0, 0, 0.14) inset`, // TODO: From current theme. Deprecate for 'button-hover' primary: "4px 4px 0px 0px hsla(var(--primary))", - "button-hover": "4px 4px 0 0 hsla(var(--primary-low-contrast))", + "button-hover": "4px 4px 0 0 hsla(var(--orange-900))", tooltip: "0 0 16px var(--tooltip-shadow)", "svg-button-link": ` var(--shadow-svg-button-link-1), var(--shadow-svg-button-link-2), From 038eaad6898a38f2a14ab61e8e54112816877348 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Sat, 7 Sep 2024 15:25:26 -0700 Subject: [PATCH 06/28] feat: update all button variants to match DS --- src/components/ui/buttons/Button.tsx | 35 +++++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/components/ui/buttons/Button.tsx b/src/components/ui/buttons/Button.tsx index fbf4e1278d8..fc2c91dda55 100644 --- a/src/components/ui/buttons/Button.tsx +++ b/src/components/ui/buttons/Button.tsx @@ -9,20 +9,37 @@ import { scrollIntoView } from "@/lib/utils/scrollIntoView" import { BaseLink, type LinkProps } from "../Link" const buttonVariants = cva( - "pointer inline-flex gap-2 items-center justify-center rounded border border-solid border-current text-primary transition focus-visible:outline focus-visible:outline-4 focus-visible:outline-primary-hover focus-visible:-outline-offset-1 disabled:text-disabled disabled:pointer-events-none hover:text-primary-hover [&[data-secondary='true']]:text-body [&>svg]:flex-shrink-0", + cn( + // Sizing and positioning classes: + "inline-flex gap-2 items-center justify-center rounded border border-solid transition [&>svg]:flex-shrink-0", + // Base default styling is "outline" pattern, primary color for text, border matches, no bg + "text-primary border-current", + // Hover: Default hover adds button-hover shadow, text (border) to --primary-hover + "hover:!text-primary-hover hover:shadow-button-hover", + // Focus: Add 4px outline to all buttons, --primary-hover + "focus-visible:outline focus-visible:outline-primary-hover focus-visible:outline-4 focus-visible:-outline-offset-1", + // Active: text (border) to --primary-hover instead of primary, hide shadow + "active:text-primary-hover active:shadow-none", + // Disabled: Pointer events none, text (border) to --disabled + "disabled:pointer-events-none disabled:text-disabled", + // isSecondary: Switch text (border) to --body instead of --primary + "[&[data-secondary='true']]:text-body" + ), { variants: { variant: { - solid: - "text-white bg-primary-action border-transparent disabled:bg-disabled disabled:text-background hover:text-white hover:bg-primary-action-hover hover:shadow-button-hover active:shadow-none", - outline: "hover:shadow-button-hover active:shadow-none text-body", - "outline-color": - "hover:shadow-button-hover active:shadow-none border-primary", - ghost: "border-transparent", - link: "border-transparent font-bold underline py-0 px-1 active:text-primary", + solid: cn( + "text-white bg-primary-action !border-transparent", + "hover:!text-white hover:bg-primary-action-hover", // Hover + "active:bg-primary-action-hover", // Active + "disabled:bg-disabled disabled:text-background" // Disabled + ), + outline: "", // Base styling + ghost: "border-transparent hover:shadow-none", + link: "border-transparent hover:shadow-none underline py-0 px-1 active:text-primary", }, size: { - lg: "text-lg py-3 px-8 [&>svg]:text-2xl rounded-lg", + lg: "text-lg py-3 px-8 [&>svg]:text-2xl rounded-lg focus-visible:rounded-lg", md: "min-h-10.5 px-4 py-2 [&>svg]:text-2xl", sm: "text-xs min-h-[31px] py-1.5 px-2 [&>svg]:text-md", }, From 71d7b3cf9a1aea663093abf572b2322860c7bbb2 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Sat, 7 Sep 2024 15:27:14 -0700 Subject: [PATCH 07/28] fix: button variants to use latest updates "solid" default variant, "outline" includes color, `isSecondary` removes color from default outline/ghost states --- src/components/FeedbackCard.tsx | 12 +++--------- src/pages/index.tsx | 10 +++++++++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/FeedbackCard.tsx b/src/components/FeedbackCard.tsx index 190325d2fb4..4caf5327c24 100644 --- a/src/components/FeedbackCard.tsx +++ b/src/components/FeedbackCard.tsx @@ -75,23 +75,17 @@ const FeedbackCard = ({ prompt, isArticle, ...props }: FeedbackCardProps) => {
{!feedbackSubmitted ? ( <> - - ) : ( - )} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index a294aac62e2..d98a59dc038 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -327,7 +327,12 @@ const HomePage = ({ ))}
- + {t("page-index:page-index-popular-topics-action")}{" "} @@ -362,6 +367,7 @@ const HomePage = ({ href="/developers/docs/" size="lg" variant="outline" + isSecondary className="w-fit" > {t("page-index:page-index-builders-action-secondary")} @@ -437,6 +443,7 @@ const HomePage = ({ href="/discord/" size="lg" variant="outline" + isSecondary hideArrow > @@ -445,6 +452,7 @@ const HomePage = ({ href={GITHUB_REPO_URL} size="lg" variant="outline" + isSecondary hideArrow > From bbcf48c3f2568da8af0eb7e0fab77da0e123de87 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Sat, 7 Sep 2024 16:28:54 -0700 Subject: [PATCH 08/28] feat: sync Chakra-UI button variant styles to DS --- src/@chakra-ui/components/Button.ts | 52 +++++++++++++++++------------ 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/src/@chakra-ui/components/Button.ts b/src/@chakra-ui/components/Button.ts index c0741641a70..eeecbe3153c 100644 --- a/src/@chakra-ui/components/Button.ts +++ b/src/@chakra-ui/components/Button.ts @@ -11,27 +11,40 @@ import { defineStyle, defineStyleConfig } from "@chakra-ui/react" const ICON_SELECTOR = "& svg" const baseStyle = defineStyle({ + // Sizing and positioning classes: borderRadius: "base", border: "1px", - color: "primary.base", fontWeight: "normal", lineHeight: "1.6", transitionProperty: "common", transitionDuration: "normal", whiteSpace: "normal", p: "unset", + // Base default styling is "outline" pattern, primary color for text, border matches, no bg + borderColor: "currentColor", + color: "primary.base", + // Hover: Default hover adds button-hover shadow, text (border) to --primary-hover + _hover: { + color: "primary.hover", + boxShadow: "buttonHover", + }, + // Focus: Add 4px outline to all buttons, --primary-hover _focusVisible: { outline: "4px solid", outlineColor: "primary.hover", outlineOffset: -1, }, + // Active: text (border) to --primary-hover instead of primary, hide shadow + _active: { + color: "primary.hover", + boxShadow: "none", + }, + // Disabled: Pointer events none, text (border) to --disabled _disabled: { color: "disabled", pointerEvents: "none", }, - _hover: { - color: "primary.hover", - }, + // isSecondary: Switch text (border) to --body instead of --primary "&[data-secondary='true']": { color: "body.base", }, @@ -41,42 +54,39 @@ const baseStyle = defineStyle({ textDecoration: "none", }, }, + [ICON_SELECTOR]: { + flexShrink: 0, + }, }) const variantSolid = defineStyle({ color: "white", bg: "primary.action", - borderColor: "transparent", - _disabled: { - bg: "disabled", - color: "background.base", - }, + borderColor: "transparent !important", _hover: { - color: "white", + color: "white !important", bg: "primary.actionHover", - boxShadow: "buttonHover", }, _active: { - boxShadow: "none", - }, -}) - -const variantOutline = defineStyle({ - _hover: { - boxShadow: "buttonHover", + bg: "primary.actionHover", }, - _active: { - boxShadow: "none", + _disabled: { + bg: "disabled", + color: "background.base", }, }) +const variantOutline = defineStyle({}) // "outline" is base styling above + const variantGhost = { borderColor: "transparent", + _hover: { shadow: "none" }, } const variantLink = defineStyle({ borderColor: "transparent", - fontWeight: 700, + // fontWeight: 700, // TODO: Not in DS; confirm then remove + _hover: { shadow: "none" }, textDecor: "underline", py: 0, px: 1, From 02d9a3fc0f640df7454835d89c1f21e3096a467a Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Sat, 7 Sep 2024 16:29:22 -0700 Subject: [PATCH 09/28] patch: primary.hover _dark value --- src/@chakra-ui/semanticTokens.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/@chakra-ui/semanticTokens.ts b/src/@chakra-ui/semanticTokens.ts index 974c08bb1d9..0fd3a3f63cd 100644 --- a/src/@chakra-ui/semanticTokens.ts +++ b/src/@chakra-ui/semanticTokens.ts @@ -40,7 +40,7 @@ const semanticTokens = { base: { _light: "purple.600", _dark: "purple.400" }, highContrast: { _light: "purple.800", _dark: "purple.200" }, lowContrast: { _light: "purple.100", _dark: "purple.900" }, - hover: { _light: "purple.500", _dark: "purple.500" }, + hover: { _light: "purple.500", _dark: "purple.300" }, visited: { _light: "purple.700", _dark: "purple.300" }, action: { _light: "purple.600", _dark: "purple.600" }, actionHover: { _light: "purple.500", _dark: "purple.500" }, From 5cdb1c06faa01f640eda55abb5ce21164df0686d Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Sat, 7 Sep 2024 18:04:23 -0700 Subject: [PATCH 10/28] fix: dark chakra background color --- src/@chakra-ui/semanticTokens.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/@chakra-ui/semanticTokens.ts b/src/@chakra-ui/semanticTokens.ts index 0fd3a3f63cd..b1d447bd07b 100644 --- a/src/@chakra-ui/semanticTokens.ts +++ b/src/@chakra-ui/semanticTokens.ts @@ -57,7 +57,7 @@ const semanticTokens = { light: { _light: "gray.200", _dark: "gray.600" }, }, background: { - base: { _light: "white", _dark: "gray.950" }, + base: { _light: "white", _dark: "black" }, highlight: { _light: "gray.100", _dark: "gray.900" }, }, disabled: { _light: "gray.400", _dark: "gray.500" }, From 46cc6fb2861b62f4534c9a8209a478d72dcc21b1 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Sat, 7 Sep 2024 18:06:02 -0700 Subject: [PATCH 11/28] feat: migrate nav element, add border-b --- src/components/Nav/index.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/Nav/index.tsx b/src/components/Nav/index.tsx index da8f00c4202..10c79de2de8 100644 --- a/src/components/Nav/index.tsx +++ b/src/components/Nav/index.tsx @@ -8,8 +8,6 @@ import Search from "@/components/Search" import { isDesktop } from "@/lib/utils/isDesktop" -import { NAV_PY } from "@/lib/constants" - import DesktopNavMenu from "./Desktop" import Menu from "./Menu" import { useNav } from "./useNav" @@ -30,17 +28,10 @@ const Nav = () => { return ( - { - + ) } From 0e92088b0c8b7383075e7f2c91646b036f98a584 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Sat, 7 Sep 2024 18:35:28 -0700 Subject: [PATCH 12/28] fix: rm focus styling consistent with other nav items --- src/components/Nav/Desktop/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Nav/Desktop/index.tsx b/src/components/Nav/Desktop/index.tsx index 92214ca540c..7f02b966e41 100644 --- a/src/components/Nav/Desktop/index.tsx +++ b/src/components/Nav/Desktop/index.tsx @@ -22,6 +22,7 @@ const DesktopNavMenu = ({ toggleColorMode }: DesktopNavMenuProps) => { const ThemeIcon = useColorModeValue(, ) const themeIconAriaLabel = useColorModeValue( + // TODO: add i18n support "Switch to Dark Theme", "Switch to Light Theme" ) @@ -65,7 +66,6 @@ const DesktopNavMenu = ({ toggleColorMode }: DesktopNavMenuProps) => { }, }} _hover={desktopHoverFocusStyles} - _focus={desktopHoverFocusStyles} onClick={toggleColorMode} /> From 5d551cb856dbe8cb1e4065adbd465af17cd5754c Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Sat, 7 Sep 2024 18:49:55 -0700 Subject: [PATCH 13/28] fix: nav button styling consistency --- src/components/Nav/Desktop/index.tsx | 44 ++++++++++++-------------- src/components/Search/SearchButton.tsx | 2 +- src/components/Search/index.tsx | 2 +- src/styles/docsearch.css | 4 +-- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/components/Nav/Desktop/index.tsx b/src/components/Nav/Desktop/index.tsx index 7f02b966e41..a16e131116b 100644 --- a/src/components/Nav/Desktop/index.tsx +++ b/src/components/Nav/Desktop/index.tsx @@ -5,10 +5,11 @@ import { BsTranslate } from "react-icons/bs" import { MdBrightness2, MdWbSunny } from "react-icons/md" import { HStack, useColorModeValue, useEventListener } from "@chakra-ui/react" -import { IconButton } from "@/components/Buttons" import LanguagePicker from "@/components/LanguagePicker" import { Button } from "@/components/ui/buttons/Button" +import { cn } from "@/lib/utils/cn" + import { DESKTOP_LANGUAGE_BUTTON_NAME } from "@/lib/constants" type DesktopNavMenuProps = { @@ -20,21 +21,12 @@ const DesktopNavMenu = ({ toggleColorMode }: DesktopNavMenuProps) => { const { locale } = useRouter() const languagePickerRef = useRef(null) - const ThemeIcon = useColorModeValue(, ) const themeIconAriaLabel = useColorModeValue( - // TODO: add i18n support + // TODO: Add i18n support "Switch to Dark Theme", "Switch to Light Theme" ) - const desktopHoverFocusStyles = { - "& > svg": { - transform: "rotate(10deg)", - color: "primary.hover", - transition: "transform 0.5s, color 0.2s", - }, - } - /** * Adds a keydown event listener to toggle color mode (ctrl|cmd + \) * or open the language picker (\). @@ -54,20 +46,26 @@ const DesktopNavMenu = ({ toggleColorMode }: DesktopNavMenuProps) => { return ( - svg": { - transition: "transform 0.5s, color 0.2s", - }, - }} - _hover={desktopHoverFocusStyles} + className="group p-2 hover:!text-primary-hover xl:p-3" onClick={toggleColorMode} - /> + aria-label={themeIconAriaLabel} + > + + + {/* Locale-picker menu */} @@ -75,7 +73,7 @@ const DesktopNavMenu = ({ toggleColorMode }: DesktopNavMenuProps) => { name={DESKTOP_LANGUAGE_BUTTON_NAME} ref={languagePickerRef} variant="ghost" - className="gap-0 px-2 text-body transition-colors duration-200 active:bg-primary-low-contrast active:text-primary-hover data-[state='open']:bg-primary-low-contrast data-[state='open']:text-primary-hover xl:px-3 [&>svg]:transition-transform [&>svg]:duration-500 [&_svg]:hover:rotate-12" + className="gap-0 px-2 text-body transition-colors duration-500 active:bg-primary-low-contrast active:text-primary-hover data-[state='open']:bg-primary-low-contrast data-[state='open']:text-primary-hover xl:px-3 [&_svg]:transition-transform [&_svg]:duration-500 [&_svg]:hover:rotate-12" > diff --git a/src/components/Search/SearchButton.tsx b/src/components/Search/SearchButton.tsx index 19ae404f87c..a475d2111de 100644 --- a/src/components/Search/SearchButton.tsx +++ b/src/components/Search/SearchButton.tsx @@ -12,7 +12,7 @@ const SearchButton = React.forwardRef(
From cf3814158da52882659375021a527555e120e3cd Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:54:42 -0700 Subject: [PATCH 23/28] fix: button-hover shadow color deprecate single-use `button-hover` tailwind token; applied directly at ui/button component level --- src/@chakra-ui/components/Button.ts | 2 +- src/components/ui/buttons/Button.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/@chakra-ui/components/Button.ts b/src/@chakra-ui/components/Button.ts index eeecbe3153c..5d46960d242 100644 --- a/src/@chakra-ui/components/Button.ts +++ b/src/@chakra-ui/components/Button.ts @@ -23,7 +23,7 @@ const baseStyle = defineStyle({ // Base default styling is "outline" pattern, primary color for text, border matches, no bg borderColor: "currentColor", color: "primary.base", - // Hover: Default hover adds button-hover shadow, text (border) to --primary-hover + // Hover: Default hover adds box-shadow, text (border) to --primary-hover _hover: { color: "primary.hover", boxShadow: "buttonHover", diff --git a/src/components/ui/buttons/Button.tsx b/src/components/ui/buttons/Button.tsx index fc2c91dda55..9d089a1698d 100644 --- a/src/components/ui/buttons/Button.tsx +++ b/src/components/ui/buttons/Button.tsx @@ -14,8 +14,8 @@ const buttonVariants = cva( "inline-flex gap-2 items-center justify-center rounded border border-solid transition [&>svg]:flex-shrink-0", // Base default styling is "outline" pattern, primary color for text, border matches, no bg "text-primary border-current", - // Hover: Default hover adds button-hover shadow, text (border) to --primary-hover - "hover:!text-primary-hover hover:shadow-button-hover", + // Hover: Default hover adds box-shadow, text (border) to --primary-hover + "hover:!text-primary-hover hover:shadow-[4px_4px_theme('colors.primary.low-contrast')]", // Focus: Add 4px outline to all buttons, --primary-hover "focus-visible:outline focus-visible:outline-primary-hover focus-visible:outline-4 focus-visible:-outline-offset-1", // Active: text (border) to --primary-hover instead of primary, hide shadow From 488f32eb8ca14bd490934c62f3e06e92861e2782 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:56:00 -0700 Subject: [PATCH 24/28] deprecate: unused shadow tokens tw `primary`, `button-hover` shadow tokens; chakra `primary` shadow token --- src/@chakra-ui/foundations/shadows.ts | 3 +-- tailwind.config.ts | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/@chakra-ui/foundations/shadows.ts b/src/@chakra-ui/foundations/shadows.ts index ee4ff14e936..15190c39b41 100644 --- a/src/@chakra-ui/foundations/shadows.ts +++ b/src/@chakra-ui/foundations/shadows.ts @@ -20,8 +20,7 @@ const shadows = { gridBlueBowShadow: "8px 8px 0px 0px var(--eth-colors-gridBlue)", // * Part of new DS - // TODO: From current theme. Deprecate for 'buttonHover' - primary: "4px 4px 0px 0px var(--eth-colors-primary-light)", + // TODO: Deprecate buttonHover when all buttons migrated to tailwind buttonHover: "4px 4px 0 0 var(--eth-colors-primary-lowContrast)", tooltip: "0 0 16px var(--eth-colors-tooltipShadow)", } diff --git a/tailwind.config.ts b/tailwind.config.ts index 9a1edf1cb1e..109602192f2 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -201,9 +201,6 @@ const config = { "menu-accordion": ` 0px 2px 2px 0px rgba(0, 0, 0, 0.12) inset, 0px -3px 2px 0px rgba(0, 0, 0, 0.14) inset`, - // TODO: From current theme. Deprecate for 'button-hover' - primary: "4px 4px 0px 0px hsla(var(--primary))", - "button-hover": "4px 4px 0 0 hsla(var(--orange-900))", tooltip: "0 0 16px var(--tooltip-shadow)", "svg-button-link": ` var(--shadow-svg-button-link-1), var(--shadow-svg-button-link-2), From 6f724bd50e8a09e7b03f3997b16c8c8995c1788f Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:43:38 -0700 Subject: [PATCH 25/28] chore: persist gradient for bg in dark mode --- src/components/EthPriceCard.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/EthPriceCard.tsx b/src/components/EthPriceCard.tsx index 1071f6f2dbd..3b3ab3670f5 100644 --- a/src/components/EthPriceCard.tsx +++ b/src/components/EthPriceCard.tsx @@ -110,7 +110,6 @@ const EthPriceCard = ({ isNegativeChange ? "bg-gradient-to-b from-error/10 dark:border-error/50" : "bg-gradient-to-t from-success/20 dark:border-success/50", - "dark:from-transparent", className )} {...props} From 9fe7aaa2fa7b6260ba90210ea54440953467f5d8 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Tue, 10 Sep 2024 12:41:51 -0700 Subject: [PATCH 26/28] fix: close button styling on DismissableBanner --- src/components/Banners/DismissableBanner/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Banners/DismissableBanner/index.tsx b/src/components/Banners/DismissableBanner/index.tsx index 47acac35b38..1384c497572 100644 --- a/src/components/Banners/DismissableBanner/index.tsx +++ b/src/components/Banners/DismissableBanner/index.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from "react" +import { useTranslation } from "next-i18next" import { MdClose } from "react-icons/md" import { Button } from "@/components/ui/buttons/Button" @@ -17,6 +18,7 @@ const DismissableBanner = ({ storageKey, className, }: DismissableBannerProps) => { + const { t } = useTranslation("common") const [show, setShow] = useState(false) useEffect(() => { @@ -33,10 +35,10 @@ const DismissableBanner = ({
{children}
From 08b816b8a5cd5c67a5bdeb2360aa7753b55ded39 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:19:19 -0700 Subject: [PATCH 27/28] rm: unused and unavaiable styling --- src/styles/docsearch.css | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/styles/docsearch.css b/src/styles/docsearch.css index a5ccb736cce..791511b60c8 100644 --- a/src/styles/docsearch.css +++ b/src/styles/docsearch.css @@ -112,11 +112,6 @@ @apply text-body; } -.DocSearch-Hit-Select-Icon:focus, -.DocSearch-Hit-Select-Icon:hover { - @apply text-switch-background; -} - .DocSearch-Footer { --docsearch-footer-height: theme(spacing.10); --docsearch-logo-color: theme(textColor.body.light); From 594cddc380d0fc2360009f44b2b9cb42e9107890 Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Tue, 10 Sep 2024 19:47:54 -0700 Subject: [PATCH 28/28] fix: declare group; align component name --- src/components/Search/SearchInputButton.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Search/SearchInputButton.tsx b/src/components/Search/SearchInputButton.tsx index 8959f776510..fc278e2ad09 100644 --- a/src/components/Search/SearchInputButton.tsx +++ b/src/components/Search/SearchInputButton.tsx @@ -6,7 +6,7 @@ import { cn } from "@/lib/utils/cn" import { Button, type ButtonProps } from "../ui/buttons/Button" -const SearchButton = React.forwardRef( +const SearchInputButton = React.forwardRef( ({ className, ...props }, ref) => { const { t } = useTranslation("common") @@ -16,7 +16,7 @@ const SearchButton = React.forwardRef( aria-label={t("aria-toggle-search-button")} variant="ghost" className={cn( - "me-3 border border-disabled hover:border-primary-hover", + "group me-3 border border-disabled hover:border-primary-hover", className )} {...props} @@ -33,6 +33,6 @@ const SearchButton = React.forwardRef( } ) -SearchButton.displayName = "SearchButton" +SearchInputButton.displayName = "SearchButton" -export default SearchButton +export default SearchInputButton