Remove unnecessary padding-right on the dismissible notice #52240
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
In this PR I removed the
padding-right
from a Notice component when it's dismissable.Why?
When Notice was dismissable, an additional 36px
padding-right
was applied to the Notice container, pushing the content to the left, which makes little space for Notice content especially when used in Inspector Controls. It seems incorrect on the frontend (see screenshots below).Worth to mention that the "X" button is coincidentally 36px wide, so the original idea might've been to apply the padding so the content makes space for an "X" button, but now it pushes both: "X" button and content.
How?
It's fixed by removing the unnecessary padding-right from the
.components-notice.is-dismissable
selector.Testing Instructions
Notice component is dismissable by default, so there's no need to pass any additional props to it.
2. Display the Notice in the frontend
3. Expected: There's no unnecessary gap on the right side (check screenshots below).
Screenshots or screencast