-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Snackbar: Fix icon positioning #57377
Changes from 3 commits
c272e90
07dc07a
8573000
312752d
dd5613c
a9dc3d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,13 +29,14 @@ | |
} | ||
|
||
.components-snackbar__content-with-icon { | ||
margin-left: $grid-unit-30; | ||
position: relative; | ||
padding-left: $grid-unit-30; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was about to suggest using logical properties (inline-start instead of left), but I guess that it doesn't matter much in Sass files, since RTL styles should be automatically generated. |
||
} | ||
|
||
.components-snackbar__icon { | ||
position: absolute; | ||
top: 24px; | ||
left: 28px; | ||
left: $grid-unit-10 * -1; | ||
top: -3px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the icon supposed to be top aligned when the snackbar text breaks on 2+ lines? More in general, we should probably switch to a more generic approach to vertically centering the icon that doesn't rely on an exact px value, since it would make the alignment more resilient to things like font changes, etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Correct. It matches the alignment of the actions and dismiss button as well.
Added a few tweaks to avoid this in 312752d 👍 |
||
} | ||
|
||
.components-snackbar__dismiss-button { | ||
|
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.
Not great that this requires a
style
, but we can't really add it in the component CSS due to back-compat.Hopefully things will be nicer once we have #40102.