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

fix(styles): update placeholder colors #4799

Merged
merged 5 commits into from
Dec 19, 2019

Conversation

asudoh
Copy link
Contributor

@asudoh asudoh commented Nov 29, 2019

This change updates placeholder color from $text-03 to $text-05 to meet the color contrast requirement.

This change also replaces manual usage of colors in style rules with the Sass mixin for placeholder @include placeholder-colors.

Fixes #4231.
Fixes #4225.
Fixes #4254.

Changelog

Changed

  • Placeholder colors, to $text-05.
  • Manual color usage in style rules for placeholders, to use @include placeholder-colors.

Testing / Reviewing

Testing should make sure the following components are not broken:

  • Combo box
  • Date picker
  • Filterable multi select
  • Search
  • Text input
  • Text area
  • Time picker

This change updates placeholder color from `$text-03` to `$text-05` to
meet the color contrast requirement.

This change also replaces manual usage of colors in style rules with
the Sass mixin for placeholder `@include placeholder-colors`.

Fixes carbon-design-system#4231.
@asudoh asudoh requested review from emyarod, abbeyhrt and a team November 29, 2019 03:37
@asudoh asudoh requested a review from a team as a code owner November 29, 2019 03:37
@ghost ghost requested review from jeanservaas and removed request for a team November 29, 2019 03:37
@netlify
Copy link

netlify bot commented Nov 29, 2019

Deploy preview for the-carbon-components ready!

Built with commit 163ca36

https://deploy-preview-4799--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Nov 29, 2019

Deploy preview for carbon-components-react failed.

Built with commit 163ca36

https://app.netlify.com/sites/carbon-components-react/deploys/5dfac0864c462e0008622621

@netlify
Copy link

netlify bot commented Nov 29, 2019

Deploy preview for carbon-elements ready!

Built with commit 163ca36

https://deploy-preview-4799--carbon-elements.netlify.com

@abbeyhrt
Copy link
Contributor

abbeyhrt commented Dec 2, 2019

@aagonzales Hey! We talked about adjusting the value of placeholder colors here #4281 (comment) and you said it might be better to just change the value of $text-03 to the value of $text-05, would we still want to do that or is it too late?

@abbeyhrt abbeyhrt requested review from aagonzales and removed request for jeanservaas December 2, 2019 18:27
@aagonzales
Copy link
Member

aagonzales commented Dec 2, 2019

I don't have a quick answer for you. I kind of forget the thread of this decision. I want to look at all this again and make sure we're updating the token correctly. I need to focus on finishing up my pattern work right now and don't want to get distracted so I can take a look at this later this week maybe.

Copy link
Contributor

@abbeyhrt abbeyhrt left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@abbeyhrt
Copy link
Contributor

abbeyhrt commented Dec 3, 2019

Hey @asudoh! Looking into it, I think this will also fix #4254!

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

looks good to me, pending visual review

Copy link
Contributor

@jeanservaas jeanservaas left a comment

Choose a reason for hiding this comment

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

Talked to @aagonzales about this and there's some confusion; need to re-review this after patterns push.

Copy link
Member

@aagonzales aagonzales left a comment

Choose a reason for hiding this comment

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

I have confirmed with Bo Campbell, if the "placeholder" text is actually displaying the format of the input or a prompt then it needs to pass color contrast. If however it is non-informational text (ie an example) then it can remain the low contrast placeholder color text-03

Ok so that are 3 possibilities:

  • text-01: option text, 4.5:1 contrast
    • selects
    • drop-downs
  • text-03: placeholder low contrast, non-informational text
    • text input
    • text area
  • text-05: format text or prompt, 4.5:1 contrast
    • date picker
    • time picker
    • search

image

Side note: we should actually probably figure out how to display the format in date and time picker to be present outside of the field.

@@ -47,7 +47,7 @@
/// @example @include placeholder-colors;
/// @group global-helpers
@mixin placeholder-colors {
color: $text-03;
color: $text-05;
Copy link
Member

Choose a reason for hiding this comment

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

This should stay text-03 as it is the official "placeholder" text token.

@@ -51,7 +51,7 @@
}

&::placeholder {
color: $text-05;
@include placeholder-colors;
Copy link
Member

Choose a reason for hiding this comment

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

Search should be using text-05 since placeholder text is being changed back to text-03

@@ -19,8 +19,7 @@
@mixin combo-box {
.#{$prefix}--combo-box .#{$prefix}--text-input {
&::placeholder {
color: $text-02;
opacity: 1;
@include placeholder-colors;
Copy link
Member

Choose a reason for hiding this comment

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

should be text-05

@asudoh
Copy link
Contributor Author

asudoh commented Dec 18, 2019

Thanks for the updated spec @aagonzales - Updated.

Copy link
Member

@aagonzales aagonzales left a comment

Choose a reason for hiding this comment

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

👍

@asudoh asudoh merged commit ed077c6 into carbon-design-system:master Dec 19, 2019
@asudoh asudoh deleted the placeholder-color branch December 19, 2019 00:44
joshblack pushed a commit to joshblack/carbon that referenced this pull request Jan 6, 2020
This change updates placeholder color of some components from
`$text-03` to e.g. `$text-05` to meet the color contrast requirement.

This change also replaces manual usage of colors in style rules with
the Sass mixin for placeholder `@include placeholder-colors`.

Fixes carbon-design-system#4231.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants