Skip to content

Commit ff9d7dd

Browse files
authored
refactor(ui5-button): remove iconSize property (#3227)
iconSize is a public property that is used only for the purpose of the MessageStrip close button. Remove the property and add a Shadow Part so the MessageStrip can re-style the button. Part of #3107 BREAKING_CHANGE: iconSize property of ui5-button has been deprecated
1 parent 8c66d5a commit ff9d7dd

File tree

4 files changed

+12
-29
lines changed

4 files changed

+12
-29
lines changed

packages/main/src/Button.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
>
2525
{{#if icon}}
2626
<ui5-icon
27-
style="{{styles.icon}}"
2827
class="ui5-button-icon"
2928
name="{{icon}}"
29+
part="icon"
3030
?show-tooltip={{showIconTooltip}}
3131
></ui5-icon>
3232
{{/if}}

packages/main/src/Button.js

-22
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,6 @@ const metadata = {
9393
type: Boolean,
9494
},
9595

96-
/**
97-
* Defines the size of the icon inside the <code>ui5-button</code>.
98-
*
99-
* @type {string}
100-
* @defaultvalue undefined
101-
* @public
102-
* @since 1.0.0-rc.8
103-
*/
104-
iconSize: {
105-
type: String,
106-
defaultValue: undefined,
107-
},
108-
10996
/**
11097
* When set to <code>true</code>, the <code>ui5-button</code> will
11198
* automatically submit the nearest form element upon <code>press</code>.
@@ -486,15 +473,6 @@ class Button extends UI5Element {
486473
return this.iconOnly && !this.title;
487474
}
488475

489-
get styles() {
490-
return {
491-
icon: {
492-
width: this.iconSize,
493-
height: this.iconSize,
494-
},
495-
};
496-
}
497-
498476
static async onDefine() {
499477
await fetchI18nBundle("@ui5/webcomponents");
500478
}

packages/main/src/MessageStrip.hbs

+5-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424

2525
{{#unless noCloseButton}}
2626
<ui5-button
27-
icon="decline"
28-
icon-size=".75rem"
29-
design="Transparent"
30-
class="ui5-messagestrip-close-button"
31-
title="{{_closeButtonText}}"
32-
@click={{_closeClick}}
27+
icon="decline"
28+
design="Transparent"
29+
class="ui5-messagestrip-close-button"
30+
title="{{_closeButtonText}}"
31+
@click={{_closeClick}}
3332
></ui5-button>
3433
{{/unless}}
3534
</div>

packages/main/src/themes/MessageStrip.css

+6
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,16 @@
9191
top: 0.125rem;
9292
color: var(--sapTextColor);
9393
}
94+
9495
.ui5-messagestrip-close-button[active] {
9596
color: var(--sapButton_Active_TextColor);
9697
}
9798

99+
.ui5-messagestrip-close-button::part(icon) {
100+
width: .75rem;
101+
height: .75rem;
102+
}
103+
98104
/* RTL */
99105
.ui5-messagestrip-root[dir="rtl"] {
100106
padding-right: 2.5rem;

0 commit comments

Comments
 (0)