Skip to content

Commit 1044daa

Browse files
authored
fix(ui5-button): make buttons truncate (#1586)
1 parent 292455b commit 1044daa

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

packages/fiori/src/themes/ShellBar.css

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
position: relative;
3434
font-size: 0.75rem;
3535
font-weight: bold;
36+
white-space: initial;
37+
overflow: initial;
38+
text-overflow: initial;
3639
}
3740

3841
.ui5-shellbar-menu-button,

packages/main/src/themes/Button.css

+9-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
border: 1px solid var(--sapButton_BorderColor);
1818
color: var(--sapButton_TextColor);
1919
box-sizing: border-box;
20+
white-space: nowrap;
21+
overflow: hidden;
22+
text-overflow: ellipsis;
2023
}
2124

2225
:host([disabled]) {
@@ -93,10 +96,15 @@
9396
text-overflow: inherit;
9497
}
9598

96-
:host([has-icon]) .ui5-button-text {
99+
:host([has-icon]:not([icon-end])) .ui5-button-text {
100+
max-width: calc(100% - 1rem);
97101
margin-left: var(--_ui5_button_base_icon_margin);
98102
}
99103

104+
:host([has-icon][icon-end]) .ui5-button-text {
105+
margin-left: 0;
106+
}
107+
100108
:host([disabled]) {
101109
opacity: 0.5;
102110
pointer-events: none;

packages/main/test/pages/Button.html

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
<ui5-button icon="employee" aria-label="Download book">Action Bar Button</ui5-button>
6767
<ui5-button icon="download"></ui5-button>
6868

69+
<ui5-button icon="employee" aria-label="Download book" style="width: 6rem;">Action Bar Button</ui5-button>
70+
<ui5-button icon="employee" icon-end aria-label="Download book" style="width: 6rem;">Action Bar Button</ui5-button>
71+
6972
<br />
7073
<br />
7174

0 commit comments

Comments
 (0)