-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
Size stats
|
Accessibility report ℹ️ You can run this locally by executing |
Screenshot tests report ✔️ All passing |
Deploy preview for mistica-web ready! ✅ Preview Built with commit 43028a4. |
It would be a good idea to add a snippet that uses the backgroundColor for those who are going to use the playroom. |
In the storybook, it's better to move up the backgroundColor to be below the background, so when you see the two properties |
@@ -58,6 +60,8 @@ export const Default: StoryComponent<PosterCardArgs> = ({ | |||
width, | |||
height, | |||
aspectRatio, | |||
inverse, |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
andpressed
styles should usetouchableCardOverlayMedia
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
andpressed
styles should usetouchableCardOverlay
. 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
andpressed
styles should usetouchableCardOverlayInverse
. Since the background will bebackgroundContainerBrand
(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%) andpressed
(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 usesneutralHigh
. - 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 usesinverse
.
I hope the explanation is more clear now 😃
There was a problem hiding this 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 :(
https://www.figma.com/file/tKdPOfcUALzVIh5oizFbm7/🔸-Cards-Specs?type=design&node-id=1868%3A3853&mode=design&t=fpLlSjW8QU44yIDg-1