Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

feat(Input): add inverted prop to change background color of an input #1684

Merged
merged 20 commits into from
Aug 16, 2019

Conversation

codepretty
Copy link
Collaborator

@codepretty codepretty commented Jul 19, 2019

Need to be able to have 2 different background options for inputs.

New prop inverted for changing the background color of the input
<input content="i am an input" inverted />

image

image

image


Question: This works for Teams theme scenarios, but not sure if the inverted prop is the best way to do this... thoughts?

Conclusion: After speaking with Design, we decided that inverted is the best solution we could come up with for now.

@codecov
Copy link

codecov bot commented Jul 19, 2019

Codecov Report

Merging #1684 into master will increase coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1684      +/-   ##
=========================================
+ Coverage   69.79%   69.8%   +<.01%     
=========================================
  Files         876     875       -1     
  Lines        7506    7505       -1     
  Branches     2181    2209      +28     
=========================================
  Hits         5239    5239              
+ Misses       2259    2258       -1     
  Partials        8       8
Impacted Files Coverage Δ
packages/react/src/components/Input/Input.tsx 100% <ø> (ø) ⬆️
...rc/themes/teams/components/Input/inputVariables.ts 0% <ø> (ø) ⬆️
...s-high-contrast/components/Input/inputVariables.ts 0% <ø> (ø) ⬆️
...src/themes/base/components/Input/inputVariables.ts 0% <ø> (ø) ⬆️
...ct/src/themes/base/components/Input/inputStyles.ts 7.69% <0%> (-0.65%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6607278...e8533de. Read the comment docs.

@codepretty codepretty added question Further information is requested, concerns that require additional thought are raised 🚀 ready for review and removed 🚧 WIP labels Jul 19, 2019
@codepretty codepretty changed the title [wip] Different color for inputs feature(input): add inverted prop to swap background color on an input Jul 19, 2019
@bcalvery
Copy link
Contributor

I wish there was a way for input to just know it's on a background that matches/clashes with the default background and automagically use an alternate based on the color scheme.
I think "inverted' is a bit of a misnomer because just reading it I would think "normal" is black-on-white - so "inverted" must mean white-on-black (specifically the text/background relationship). It's more like "enhancedBackgroundContrast" or "increasedBackgroundContrast"

What is making the parent have that same background color? Is there a property somewhere higher up that says this is a "callout" or something that can be used to infer that the background matches and then relevant form elements can respond - I can imagine a checkbox on that alternative background is going to blend in and might also need to have certain colors react appropriately.

Sorry I don't really have a helpful thought of how to actually solve this though.

@mnajdova
Copy link
Contributor

The important things is how Design is describing this. Do they have some design token for this input? Inverted seems reasonable to me, if developers see some design and there is stated that inverted Input should be used it will be much easier to reason about, rather then seeing the background and deciding what should the background of the input be. So I am okay with this proposal..

@codepretty codepretty removed the question Further information is requested, concerns that require additional thought are raised label Aug 6, 2019
@vercel vercel bot temporarily deployed to staging August 8, 2019 19:33 Inactive
@codepretty codepretty changed the title feature(input): add inverted prop to swap background color on an input feature(input): add inverted prop to change background color of an input Aug 8, 2019
@codepretty codepretty changed the title feature(input): add inverted prop to change background color of an input feat(Input): add inverted prop to change background color of an input Aug 8, 2019
Copy link
Member

@miroslavstastny miroslavstastny left a comment

Choose a reason for hiding this comment

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

Technically ok, make sure all the screener regressions are expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants