Skip to content

Commit

Permalink
[WIP][rtl][css] Fix button margins for RTL langs (#3974)
Browse files Browse the repository at this point in the history
When showing a button in RTL, margin-left/right shows up incorrectly. The needed CSS seems to be `margin-inline-start/end`.  Partially relates to #3960 

Those values do not exist in IE.  I tested these changes with a search bar's filters and `EuiHeaderLink` with icons.

english | current RTL | desired RTL 
---|---|---
![image](https://user-images.githubusercontent.com/1641515/91629484-7629b600-e997-11ea-8a29-85a7871443d4.png) | ![image](https://user-images.githubusercontent.com/1641515/91629493-95c0de80-e997-11ea-92ed-68c6af62c4c3.png) | ![image](https://user-images.githubusercontent.com/1641515/91629489-8b9ee000-e997-11ea-87c7-367749d876e2.png)


Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
  • Loading branch information
nyurik and cchaos authored Sep 2, 2020
1 parent 35fa2eb commit b82e8e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed bug in `EuiComboBox` where the input was dropping to the next line when a `EuiBadge` had a very long text ([#3968](https://github.com/elastic/eui/pull/3968))
- Fixed type mismatch between `EuiSelectable` options extended via `EuiSelectableOption` and internal option types ([#3983](https://github.com/elastic/eui/pull/3983))
- Fixed `EuiButton` CSS for RTL languages by using `margin-inline-[pos]` instead of `margin-[pos]` ([#3974](https://github.com/elastic/eui/pull/3974))

## [`28.3.0`](https://github.com/elastic/eui/tree/v28.3.0)

Expand Down
6 changes: 3 additions & 3 deletions src/global_styling/mixins/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@
flex-direction: row-reverse;

> * + * {
margin-left: 0; // 1, 2
margin-right: $euiSizeS; // 1, 2
margin-inline-start: 0; // 1, 2
margin-inline-end: $euiSizeS; // 1, 2
}
} @else {
display: flex;
justify-content: center;
align-items: center;

> * + * {
margin-left: $euiSizeS; // 1
margin-inline-start: $euiSizeS; // 1
}
}
}
Expand Down

0 comments on commit b82e8e4

Please sign in to comment.