-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat(banner): add link style #4383
Conversation
Preview: https://patternfly-pr-4383.surge.sh |
looks great!! |
@@ -57,4 +57,18 @@ | |||
z-index: var(--pf-c-banner--m-sticky--ZIndex); | |||
box-shadow: var(--pf-c-banner--m-sticky--BoxShadow); | |||
} | |||
|
|||
.pf-c-button.pf-m-link.pf-m-inline { |
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.
Looks like the styles added are limited to the inline link button component - is that intended @mcarrano or should a user be able to add a regular link, too?
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 was assuming a regular link.
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 added that. @mcarrano which examples do you want to show? Do we need all these? I put them there to make sure everything works but I'm not sure if we need to show them all as examples or not.
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.
@srambach Yes, I do feel like we have too many examples here. What's the difference between a link and an inline link? I think that the Call to action example should be removed as it's not something we recommend that banners be used for. I'm on the fence about whether we need to allow for both inline text links and link buttons. The banner was originally designed to hold short text messages like an alert. It's reasonable that you might include a text link in that message. A button implies to me some action that probably does not belong on a banner. Put I'm OK to leave it there as there might be a use case I'm not considering.
@mceledonia @lboehling I also want to get your input/feedback about the styling. Looks like the current approach is to make the link text bold and then underline on hover. I'm not sure that bold text affords a link to me. Would just underlining the link be more clear (in it's default state)?
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.
Also, although I was able to make the not-allowed cursor on the disabled button link, there are good a11y reasons not to try to make a link look disabled. Also I had to turn pointer events back on to do the cursor change for the link button, which isn't really good to do. So maybe we forget about that part?
And if we don't want to support button links, I can either take that out or leave it in just in case, and remove the examples.
I'll wait to hear about about the bold/underline.
|
||
.pf-c-button.pf-m-link.pf-m-inline { | ||
--pf-c-button--FontWeight: var(--pf-global--FontWeight--semi-bold); | ||
--pf-c-button--m-link--Color: var(--pf-c-banner--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.
I would create vars for these values instead of reusing the banner text color and using a global var for the font-weight. Then they're customizable by the user via a var without having to write out the .pf-c-button.pf-m-link.pf-m-inline
selector and redefining the button vars.
Maybe something like
// top of scss
--pf-c-banner--link--FontWeight: var(--pf-global--FontWeight--semi-bold);
--pf-c-banner--link--Color: var(--pf-c-banner--Color);
--pf-c-banner--link--hover--Color: var(--pf-c-banner--Color);
--pf-c-banner--link--disabled--Color: var(--pf-c-banner--Color);
// here
--pf-c-button--FontWeight: var(--pf-c-banner--link--FontWeight);
--pf-c-button--m-link--Color: var(--pf-c-banner--link--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.
I can remove .pf-m-inline, but .pf-c-button.pf-m-link
from the button component will override the variables if I don't create more specificity 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.
LGTM! Just a couple of small things.
color: var(--pf-c-banner--link--Color); | ||
|
||
&:hover { | ||
color: var(--pf-c-banner--link--hover--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.
color: var(--pf-c-banner--link--hover--Color); | |
--pf-c-banner--link--Color: var(--pf-c-banner--link--hover--Color); |
|
||
// stylelint-disable selector-no-qualifying-type | ||
&.pf-m-disabled { | ||
color: var(--pf-c-banner--link--disabled--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.
color: var(--pf-c-banner--link--disabled--Color); | |
--pf-c-banner--link--Color: var(--pf-c-banner--link--disabled--Color); |
// stylelint-enable selector-no-qualifying-type | ||
} | ||
|
||
.pf-c-button.pf-m-link { |
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.
targeting .pf-m-inline
is probably more ideal here since that's what we want to style. I suspect we want to leave the plain link button variant alone, as we would the other button variants like primary, secondary, tertiary, etc. my previous comment was just about being able to target the inline button links using link vars instead of always being tied to the banner color, which you've done here.
{{/button}} | ||
{{/banner}} | ||
<br> | ||
{{#> banner banner--modifier="pf-m-info"}} |
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.
looks like @mcarrano wants to remove this example
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.
// stylelint-enable selector-no-qualifying-type | ||
} | ||
|
||
.pf-m-inline { |
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 needs to be scoped so it doesn't apply styles to some other component with .pf-m-inline
@mcarrano ready for re-review |
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.
Looks good to me. Thanks for making these changes @srambach .
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!!!
🎉 This PR is included in version 4.140.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This adds styles for inline links in the banner.
@mceledonia @lboehling I don't know if we want to show all these examples or not, but I put them there for you to take a look at. Thanks!
Fixes #4360