-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(inline-notification): add 8px right padding if close button is hidden #4873
Conversation
Deploy preview for the-carbon-components ready! Built with commit 66dbc79 https://deploy-preview-4873--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit 66dbc79 https://deploy-preview-4873--carbon-components-react.netlify.com |
Deploy preview for carbon-elements ready! Built with commit 66dbc79 |
Deploy preview for the-carbon-components ready! Built with commit 0618c4a https://deploy-preview-4873--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit 0618c4a https://deploy-preview-4873--carbon-components-react.netlify.com |
Deploy preview for carbon-elements ready! Built with commit 0618c4a |
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 @laurenmrice! I just committed an update to the right spacing so that should be reflected in the previews soonl. 👍 @joshblack I ended up changing how I added spacing... since the 8px spacing would only be present if |
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 very much @jendowns for fixing!
role={role} | ||
kind={kind} | ||
className={classes} | ||
style={{ paddingRight: hideCloseButton ? spacing03 : '0' }}> |
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.
Any reason you didn't do this via Sass code (and update className
upon hideCloseButton
)...?
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.
Thanks @asudoh -- with the current structure of this component, the action button is a sibling to the close button & therefore it's difficult to target & change the action button when the close button is no longer present.
Adding a class is definitely a good alternative approach. I just went with the solution that (seemed to) add/remove the least. Would you prefer to add a class and keep the padding update in Sass only?
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 sharing your thoughts @jendowns! I'm thinking about the ability of style override by applications, which tends to lean toward Sass approach. Is it changing className
upon hideCloseButton
enough to tell the Sass code that the close button is no longer present? If my words here is not clear enough please don't hesitate to speak up - Thanks!
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.
That's a good point @asudoh -- I just committed a change that goes the classname + Sass route. Let me know what you think -- thank you!
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.
LGTM 👍 - Thanks @jendowns for the update!
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.
Action link placement looks good. Can we take off the Example Link that comes after the normal text? I don't know if that happened in this pr, but I would rather only show the action link on the right.
Thanks @laurenmrice! If you don't mind, I was wondering if we could keep those example links there? 😅 I added them in a PR a week or so ago because a change went through that prevented clicking inside the notification body text. Without the example link there previously, the change went through undetected & had an effect on both OH and I should add: technically since that notification body, or specifically the So keeping that link there could help catch any future issues with links in the body. 😅 What do you think? |
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.
Okay we can keep it there thanks for explaining, will approve. I am wondering if it could eventually be something that you could turn off and on from the story? I am just wondering if people will be confused why there is a link and also an action link.
@laurenmrice Yeah that's a good question... I'm honestly not sure if storybook knobs can allow you to customize HTML elements (specifically the BUT another option: I could add a storybook variation? Something you select on the sidebar? Right now there's |
I think we can leave it for now and I can revisit that eventually :) thanks jen! |
Closes #4864
Right now if you remove the close button in the
InlineNotification
(as shown in screenshots for #4864), the action button will be flush against the right side of the notification. For the low-contrast variation, this flush right margin is problematic because it overlaps the 1px low-contrast border.This PR proposes adding a 1px right margin to the action button so that it won't be "flush" on the right side of the notification & also won't overlap the low-contrast border:Updated to 8px nowChangelog
Changed
InlineNotification
ifhideCloseButton={true}