Skip to content

[a11y] Add dark mode support to InputWithCopy and TextInputField components #19011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dashboard/src/components/InputWithCopy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const InputWithCopy: FC<Props> = ({ value, tip = "Click to copy", classNa
return (
// max-w-lg is to mirror width of TextInput so Tooltip is positioned correctly
<div className={`w-full relative max-w-lg ${className ?? ""}`}>
<TextInput value={value} disabled className="w-full pr-8 overscroll-none" />
<TextInput value={value} disabled className="w-full pr-8 overscroll-none dark:text-[#A8A29E]" />

<Tooltip content={tip} className="absolute top-1.5 right-1">
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const TextInput: FunctionComponent<TextInputProps> = memo(
return (
<input
id={id}
className={classNames("w-full max-w-lg", className)}
className={classNames("w-full max-w-lg dark:text-[#A8A29E]", className)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • can we use a color that we use elsewhere?
  • would this not be dependent on the disabled state?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use a color that we use elsewhere?

I used the SVG color of Copy icon.


can we use a color that we use elsewhere?
would this not be dependent on the disabled state?

Looks good to me, that both of the text is readable:

image

value={value}
type={type}
placeholder={placeholder}
Expand Down