-
Notifications
You must be signed in to change notification settings - Fork 840
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 text wrapping utilities #2157
Conversation
… for better browser support
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.
@@ -12,8 +12,36 @@ import { | |||
const longLink = | |||
'http://www.hithereimalongurl.com/dave_will_just_ramble_on_in_a_long_sentence_like_this/?ok=cool'; | |||
|
|||
const wrappingExampleStyle = { |
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 don't know if it's any better or worse, and I know this was already in there, but anytime we've needed docs specific styling I've done it in the Sass over in this 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.
Yeah... this was already in the file, I just noticed it was being repeated a lot, so I just moved it to a var.
@@ -25,12 +25,23 @@ | |||
.eui-textInheritColor {color: inherit !important;} | |||
|
|||
.eui-textBreakWord { | |||
word-break: break-all !important; // Fallback for FF and IE | |||
word-break: break-word !important; | |||
// https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/ |
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 including stuff like this.
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.
Browser testing locally gets the same results as the screenshots
… for better browser support * Set `.eui-textOverflowWrap` to be deprecated * Fix up guidelines and change `. euiYScrollWithShadows` to `.eui-yScrollWithShadows`
@markov00 pointed out that our fallback for IE in
.eui-textOverflowWrap
wasn't quite right. We were close with all our text-wrapping properties but not quite right.word-break
is just to indicate how to break words, butword-wrap
tells browser if they should break. With some browsers, you can't really use the former without first setting the latter tobreak-word
.This PR fixes the original
.eui-textBreakWord
utility class to be more browser compatible.It now works on IE:
This also means that
.eui-textOverflowWrap
is now redundant to.eui-textBreakWord
so I've set that for deprecation and removed it from the docs.So now it's just back to the main 3 that work in all browsers similarly.
Change to another utility class name:
. euiYScrollWithShadows
-->.eui-yScrollWithShadows
since the former didn't match our patterns. This class was introduced not too long ago, so I doubt there are really any usages yet.Checklist
[ ] This was checked in mobile[ ] This was checked in dark mode[ ] Any props added have proper autodocs[ ] This was checked for breaking changes and labeled appropriately[ ] Jest tests were updated or added to match the most common scenarios[ ] This was checked against keyboard-only and screenreader scenarios[ ] This required updates to Framer X components