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 text wrapping utilities #2157

Merged
merged 5 commits into from
Jul 23, 2019
Merged

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Jul 23, 2019

@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, but word-wrap tells browser if they should break. With some browsers, you can't really use the former without first setting the latter to break-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 IE11
  • [ ] This was checked in dark mode
  • [ ] Any props added have proper autodocs
  • Documentation examples were added
  • A changelog entry exists and is marked appropriately
  • [ ] 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

@cchaos cchaos added style only deprecations Contains deprecations. Add them to the deprecations meta ticket after merge. labels Jul 23, 2019
Copy link
Contributor

@snide snide left a 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 = {
Copy link
Contributor

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.

https://github.com/elastic/eui/blob/master/src-docs/src/components/guide_components.scss

Copy link
Contributor Author

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/
Copy link
Contributor

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.

Copy link
Contributor

@thompsongl thompsongl left a 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

@cchaos cchaos merged commit f33c710 into elastic:master Jul 23, 2019
@cchaos cchaos deleted the fix-text-wrapping-utilities branch July 23, 2019 19:30
thompsongl pushed a commit to thompsongl/eui that referenced this pull request Sep 10, 2019
… for better browser support

* Set `.eui-textOverflowWrap` to be deprecated

* Fix up guidelines and change `. euiYScrollWithShadows` to `.eui-yScrollWithShadows`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecations Contains deprecations. Add them to the deprecations meta ticket after merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants