-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Button: Wrap text #5636
Button: Wrap text #5636
Conversation
This would be better in the stylesheet for that (particular block rather than the main stylesheet. Also you need a space between |
@paulwilde I have updated the my code by moving the css to respected css of button block. |
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 for your contribution! I've left some comments to address. It's important to note that the Block button already has specific rules for wrapping:
@@ -146,4 +146,4 @@ body.gutenberg-editor-page { | |||
font-size: $default-font-size; | |||
padding: 6px 10px; | |||
} | |||
} | |||
} |
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 file should be reverted to reintroduce the newline at the end.
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 have reverted file.
blocks/library/button/style.scss
Outdated
@@ -37,3 +37,9 @@ $blocks-button__line-height: $big-font-size + 6px; | |||
text-align: right; | |||
} | |||
} | |||
|
|||
.wp-block-button .wp-block-button__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.
There already is an appropriate selector within this file, the white-space
and word-break
rules should be updated there directly. As for their merit, I'll loop in @jasmussen.
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 @mcsf for suggesting more specific way to add css. I have added my css by your suggested way.
blocks/library/button/style.scss
Outdated
.wp-block-button .wp-block-button__link { | ||
white-space: normal; | ||
word-break: break-all; | ||
height: auto; |
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.
Is height: auto
needed?
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 think we can remove it because it does not affects the output.
blocks/library/button/style.scss
Outdated
white-space: normal; | ||
word-break: break-all; | ||
height: auto; | ||
} |
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.
Missing newline at end of file.
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 have corrected that one.
Hey, @harsh-barach, thanks for addressing the feedback. In order to be merge-ready, we're almost there! We need to clean up your Git history a little. For this, we need to:
Here's what you can do:
git reset `git merge-base origin/master HEAD`
git checkout -p
(If you make a mistake and want to start over, you can |
I have pushed my changes to Github. But how can i found whether my changes will merge in main directory of Gutenburg? |
Closed in favor of #5662. |
Description
There was an issue(5628) on adding new Button block. When we add more text on button label then text on button was not wrapping.
How Has This Been Tested?
I have tested the issue after fixing it on my local environment.
Screenshots (jpeg or gifs if applicable):
Types of changes
I have added single line of css in main.scss. By adding this single line of css issue of non wrapping of text is solved now.
Checklist:
@maddisondesigns I have solved the issue.