Skip to content

Commit

Permalink
Added euiTextBreakWord mixin to the euiTitle mixin (#5107)
Browse files Browse the repository at this point in the history
Ensures that anywhere we use the title mixin to create titles, it will break on really long words if need be. This doesn’t affect those that use it with truncation.
  • Loading branch information
cchaos authored Aug 30, 2021
1 parent 90a67ab commit 97bdc46
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `euiTextBreakWord()` mixin to the `euiTitle()` mixin to ensure all titles break long words ([#5107](https://github.com/elastic/eui/pull/5107))
- Added `euiTextBreakWord()` to `EuiFormLabels` ([#5107](https://github.com/elastic/eui/pull/5107))

**Bug fixes**

- Fixed `EuiSuperSelect`'s focus keyboard behavior when no initial value is passed, and focus label behavior ([#5097](https://github.com/elastic/eui/pull/5097))
Expand Down
1 change: 0 additions & 1 deletion src/components/form/form_row/_form_row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
align-items: stretch;

.euiFormRow__label {
@include euiTextBreakWord;
hyphens: auto;
max-width: 100%; // Fixes IE
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/table/_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
* 1. Vertically align all children.
* 2. The padding on this div allows the ellipsis to show if the content is truncated. If
* the padding was on the cell, the ellipsis would be cropped.
* 3. Support wrapping.
* 4. Prevent very long single words (e.g. the name of a field in a document) from overflowing
* the cell.
*/
Expand Down Expand Up @@ -175,7 +174,7 @@
.euiTableHeaderCell,
.euiTableFooterCell,
.euiTableCellContent--truncateText {
white-space: nowrap; /* 3 */
@include euiTextTruncate;

.euiTableCellContent__text {
overflow: hidden;
Expand Down
1 change: 0 additions & 1 deletion src/components/toast/_toast.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ $euiToastTypes: (

.euiToastHeader__title {
@include euiTitle('xs');
@include euiTextBreakWord;
font-weight: $euiFontWeightLight;
}

Expand Down
1 change: 1 addition & 0 deletions src/global_styling/mixins/_form.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Labels
@mixin euiFormLabel {
@include euiFontSizeXS;
@include euiTextBreakWord;
color: $euiTitleColor;
font-weight: $euiFontWeightSemiBold;
}
Expand Down
1 change: 1 addition & 0 deletions src/global_styling/mixins/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
}

@mixin euiTitle($size: 'm') {
@include euiTextBreakWord;
color: $euiTitleColor;

@if (map-has-key($euiTitles, $size)) {
Expand Down

0 comments on commit 97bdc46

Please sign in to comment.