Skip to content
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(card): added text wrapping to cta text #7451

Merged
merged 16 commits into from
Nov 8, 2021

Conversation

BrunnoM7
Copy link
Contributor

@BrunnoM7 BrunnoM7 commented Oct 20, 2021

Related Ticket(s)

[Card] CTA text doesn't wrap #6935

Description

Corrects the over extension of the CTA text in the Card by wrapping it.

Changelog

New

  • Added the boolean property iconInline to card-footer component
  • If the iconPlacement is set a right and iconInline is true text CTA will have the wrap behavior.

@BrunnoM7 BrunnoM7 requested a review from a team as a code owner October 20, 2021 11:59
@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Oct 20, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Oct 20, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Oct 20, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Oct 20, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Oct 20, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Oct 20, 2021

Deploy preview created for package "Web Components (Codesandbox Examples)":
https://webcomponents-codesandbox.s3-web.us-east.cloud-object-storage.appdomain.cloud/deploy-previews/7451/index.html

Built with commit: 15d0a5255d92cad2966d09fef91ae9a6da92e0af

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Oct 20, 2021

Deploy preview created for package "React (Codesandbox Examples)":
https://react-codesandbox.s3-web.us-east.cloud-object-storage.appdomain.cloud/deploy-previews/7451/index.html

Built with commit: 15d0a5255d92cad2966d09fef91ae9a6da92e0af

@jeffchew jeffchew changed the title Fix(Card): added text wrapping to cta text fix(card): added text wrapping to cta text Oct 20, 2021
Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be able to continue using flexbox to resolve the root issue so changing the footer container to a block element may not be needed at all!

@@ -127,9 +127,7 @@ class DDSCardGroup extends StableSelectorMixin(LitElement) {
const { customPropertyCardsPerRow } = this.constructor as typeof DDSCardGroup;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these changes intentional or are they carried over from a separate branch maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was carried over since I didn't touch this file.

Comment on lines 315 to 321
display: block;

svg,
::slotted(svg[slot='icon']) {
display: block;
display: inline;
transform: translate(-4px, 6px);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of changing the display rule from flex to block I think we can just set a flex-shrink: 1 on bx--card__cta__copy to resolve the original issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to use flex-shrink: 1 on bx--card__cta__copy, it wraps the text but the svg doesn't behave as part of the text as expected. It ends up behaving like this:

Screen Shot 2021-10-20 at 15 48 31

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see, would we be able to use the iconInline property that is on link-with-icon ? #6812

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for showing me this PR. I applied a similar solution as is on link-with-icon, had to add a selector to the style sheet in order to get the card-footer, but it should be working fine now. Also reverted the previews changes to the CSS.

@shixiedesign shixiedesign added the Needs design approval PRs on feature requests and new components have to get design approval before merge. label Oct 22, 2021
@shixiedesign shixiedesign self-assigned this Oct 22, 2021
@jeffchew
Copy link
Member

jeffchew commented Oct 23, 2021

@BrunnoM7 can you provide more details in your PR review description on what this is trying to solve, and what has changed?

Link(s) would also help as far as what storybook links the reviewers should be looking at.

@shixiedesign
Copy link
Contributor

Almost there! Small change:
There should be a padding right of 32px on desktop. No padding on sm:

image

@BrunnoM7
Copy link
Contributor Author

Hey @shixiedesign, thanks for the review. I just added the right padding to the CTA text. It should be working fine now.

@shixiedesign
Copy link
Contributor

shixiedesign commented Oct 28, 2021

Trying to review this, but need to update branch to get some updated Percy tests. Will return later today.

@shixiedesign
Copy link
Contributor

@BrunnoM7 is this fix not working in React?

image

@shixiedesign shixiedesign removed the Needs design approval PRs on feature requests and new components have to get design approval before merge. label Nov 4, 2021
Copy link
Contributor

@shixiedesign shixiedesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you

Copy link
Member

@emyarod emyarod left a 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!

@jeffchew jeffchew added Ready to merge Label for the pull requests that are ready to merge and removed 👀 eyes needed labels Nov 5, 2021
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2021

DCO Assistant Lite bot All Contributors have signed the CLA.

@jeffchew
Copy link
Member

jeffchew commented Nov 8, 2021

Hey @BrunnoM7 , once you sign the DCO this can get merged in.

@BrunnoM7
Copy link
Contributor Author

BrunnoM7 commented Nov 8, 2021

I have read the DCO document and I hereby sign the DCO.

@kodiakhq kodiakhq bot merged commit 5cf7ef3 into carbon-design-system:master Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge Label for the pull requests that are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants