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

PosterCard-background #844

Closed
wants to merge 8 commits into from
Closed

PosterCard-background #844

wants to merge 8 commits into from

Conversation

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

Size stats

master this branch diff
Total JS 9.42 MB 9.42 MB +689 B
JS without icons 914 kB 915 kB +689 B
Lib overhead 127 kB 127 kB 0 B
Lib overhead (gzip) 32.9 kB 32.9 kB 0 B

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

Screenshot tests report

✔️ All passing

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-a10w6pvfo-tuentisre.vercel.app

Built with commit 43028a4.
This pull request is being automatically deployed with vercel-action

@daviteixeira-tlf
Copy link
Contributor

It would be a good idea to add a snippet that uses the backgroundColor for those who are going to use the playroom.

@daviteixeira-tlf
Copy link
Contributor

daviteixeira-tlf commented Aug 7, 2023

In the storybook, it's better to move up the backgroundColor to be below the background, so when you see the two properties
be one below the other. Also add one more case when there is no media to use the backgroundColor and add the color backgroundBrand as the default backgroundColor in the storybook.

@@ -58,6 +60,8 @@ export const Default: StoryComponent<PosterCardArgs> = ({
width,
height,
aspectRatio,
inverse,
Copy link
Contributor

Choose a reason for hiding this comment

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

Adjust property name to isInverse to maintain standardization.

@@ -155,7 +162,9 @@ export const Default: StoryComponent<PosterCardArgs> = ({
width={width}
height={height}
aspectRatio={aspectRatio}
// isInverse={inverse}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you remove this comment here.

@daviteixeira-tlf
Copy link
Contributor

@atabel @aweell

Copy link
Contributor

Choose a reason for hiding this comment

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

this usage is wrong
https://tinyurl.com/24fsdre5

the possibility to change text color its only allowed for custom background color

Copy link
Contributor

Choose a reason for hiding this comment

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

update: In windows works (or isInverse doesn't works xD) as expected. In Mac OS chrome this is happening
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"the possibility to change text color its only allowed for custom background color"
The text should only change the color if it receives a background color, in the case of an image, should the color be default?

"update: In windows works (or isInverse doesn't works xD) as expected. In Mac OS chrome this is happening"
I did not understand your comment. Can you explain better?

Copy link
Contributor

@yceballost yceballost Aug 9, 2023

Choose a reason for hiding this comment

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

The text should only change the color if it receives a background color, in the case of an image, should the color be default?

Exactly. When the card has an image, the gradient covers the need to make the text visible in most of the images. So we don't need to give the possibility to make color changes in the background image and video cases

I did not understand your comment. Can you explain better?

Sure! I tried the link from my first message in Windows, and the isInverse prop doesn't works in the same way as in Chrome in Mac OS. Quite weird in my opinion.. i don't know if anybody can check this in other computes with both OS.

In chrome window 10, isInverse prop always paint the text in white (with true and false value) and in chrome in Mac OS, the prop change color as I show in the image 🤔

Do I make myself clear?

Edited: Talked with edu, the reason was dark mode

@@ -1275,7 +1279,10 @@ export const PosterCard = React.forwardRef<HTMLDivElement, PosterCardProps>(
>
{isTouchable && <div className={styles.touchableCardOverlayMedia} />}
Copy link
Contributor

Choose a reason for hiding this comment

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

When the card has an image or video defined should use the touchableCardOverlayMedia style, but when the card has no media defined or a custom color defined, depending on if it's inverse or not should use touchableCardOverlayInverse / touchableCardOverlay

Screenshot 2023-08-10 at 09 02 18

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not understand your comment. Could you explain it better?

Copy link
Contributor

@aweell aweell Aug 11, 2023

Choose a reason for hiding this comment

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

Of course! there are three cases:

  • The card has media defined: The overlay that handle the :hover and pressed styles should use touchableCardOverlayMedia that makes the layer to have a black with 25% opacity when hovered and 35% when pressed, that works in most images since we don't know how dark/light they are.
  • The card has no media defined and is inverse={false}: The overlay that handle the :hover and pressed styles should use touchableCardOverlay. Since the background will be white (the default) or a light color, the styles for the overlay are more subtle.
  • The card has no media defined and is inverse={true}: The overlay that handle the :hover and pressed styles should use touchableCardOverlayInverse. Since the background will be backgroundContainerBrand (the default), backgroundContainerBrandOverInverse if it's inside an inverse context, or a dark color, the styles for the overlay should be a little bit stronger in order to be visible.

The same applies to the top actions container (image posted in the previous comment), depending of the case the container will have different default an interaction states.

  • The card has media defined: The actions container by default is inverse at 70%, and we change the opacity for the :hover (90%) and pressed (100%) states. The icon is black.
  • The card has no media defined and is inverse={false}: The actions container by default is transparent and uses the tokens backgroundContainerHover & backgroundContainerPressed for the interaction states. The icon uses neutralHigh.
  • The card has no media defined and is inverse={true}: The actions container by default is transparent and uses the tokens backgroundContainerBrandHover & backgroundContainerBrandPressed for the interaction states. The icon uses inverse.

I hope the explanation is more clear now 😃

Copy link
Collaborator

@atabel atabel left a comment

Choose a reason for hiding this comment

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

Hi @BrunoGuimaraes103, we have a duplicated PR which implements this same feature in #841

Given this PR needs some fixes/changes, I think it would be more effective to merge #841 instead of dedicating effort to fix this. You can take a look to #841 if you want to see if it covers your needs.

Sorry for the confusion, we didn't know you were working in the same task :(

@atabel atabel closed this Aug 11, 2023
@marcoskolodny marcoskolodny deleted the posterCard-background branch August 30, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants