-
Notifications
You must be signed in to change notification settings - Fork 4
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
PIE-3778 Make the Notice icon alignment adjust with the Notice content #294
Conversation
✅ Deploy Preview for vip-design-system-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thank you for your efforts improving this! 🥇
@andrea-sdl Can you fix the alignment of the icon vertically in some situations? See the screenshot: Is this how the Figma is expecting? If so, let me know, I am good! |
No, that's not correct. Thanks @djalmaaraujo for pointing that out! |
@djalmaaraujo I updated the story + the code, mind trying again? |
Description
This PR is the third iteration on improving how we align the NoticeIcon in the Notice.
Our goal is to have the notice align between the first and second line of the content and, if the content is short, be vertically centered.
Context:
In #277 we settled for having two options
Sadly, one might want to add a specific title in the content of the notice and this would show the icon in the middle.
Example:
As such, I decided to see if Flex could help us build a way to have the vertical alignment adjust properly.
Long story short: I was able to 100% match our goals by using an empty div that will stretch if the height is enough (aligning the icon between the first and the second line) and disappear with short content.
Thanks to that, now the icon should properly align.
Result:
Checklist
Steps to Test
Outline the steps to test and verify the PR here.
Example:
npm run dev
.