Skip to content
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

WB-1672: Form fields: Update border color to offBlack50 #2199

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dirty-badgers-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/wonder-blocks-dropdown": patch
---

Update default/resting border color to fix a color contrast issue
5 changes: 5 additions & 0 deletions .changeset/eight-rice-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/wonder-blocks-form": patch
---

Update default/resting border color to fix a color contrast issue
3 changes: 3 additions & 0 deletions __docs__/wonder-blocks-form/text-field.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import packageConfig from "../../packages/wonder-blocks-form/package.json";
import ComponentInfo from "../../.storybook/components/component-info";
import TextFieldArgTypes from "./text-field.argtypes";

/**
* A TextField is an element used to accept a single line of text from the user.
*/
export default {
title: "Form / TextField",
component: TextField,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const _generateStyles = (
newStyles = {
default: {
background: error ? tokens.color.fadedRed8 : tokens.color.white,
borderColor: error ? tokens.color.red : tokens.color.offBlack16,
borderColor: error ? tokens.color.red : tokens.color.offBlack50,
borderWidth: tokens.border.width.hairline,
color: placeholder
? tokens.color.offBlack64
Expand Down
5 changes: 2 additions & 3 deletions packages/wonder-blocks-form/src/components/text-field.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from "react";
import {StyleSheet} from "aphrodite";

import {mix} from "@khanacademy/wonder-blocks-color";
import {addStyle} from "@khanacademy/wonder-blocks-core";
import {color, spacing} from "@khanacademy/wonder-blocks-tokens";
import {styles as typographyStyles} from "@khanacademy/wonder-blocks-typography";
Expand Down Expand Up @@ -303,14 +302,14 @@ const styles = StyleSheet.create({
},
default: {
background: color.white,
border: `1px solid ${color.offBlack16}`,
border: `1px solid ${color.offBlack50}`,
color: color.offBlack,
"::placeholder": {
color: color.offBlack64,
},
},
error: {
background: `${mix(color.fadedRed8, color.white)}`,
Copy link
Member Author

Choose a reason for hiding this comment

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

note: This color is now part of the official WB color palette.

background: color.fadedRed8,
border: `1px solid ${color.red}`,
color: color.offBlack,
"::placeholder": {
Expand Down