Skip to content

Commit de7382b

Browse files
authored
Merge branch 'next' into ROU-11968-avatar
2 parents a1fa791 + a0d5ad7 commit de7382b

File tree

49 files changed

+118
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+118
-25
lines changed

core/src/components/badge/badge.ionic.scss

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,12 @@
160160
// Badge in Button
161161
// --------------------------------------------------
162162

163-
:host([vertical]:not(.in-tab-button).in-button.badge-small) {
164-
@include globals.position(null, calc(-1 * var(globals.$ion-space-050)));
165-
}
166-
167-
:host([vertical]:not(.in-tab-button).in-button.badge-medium),
168-
:host([vertical]:not(.in-tab-button).in-button.badge-large) {
169-
@include globals.position(null, globals.$ion-space-050);
170-
}
171-
172163
:host(:not(:empty).in-button) {
164+
--padding-start: #{globals.$ion-scale-050};
165+
--padding-end: #{globals.$ion-scale-050};
166+
173167
@include globals.typography(globals.$ion-body-action-xs);
168+
174169
min-width: globals.$ion-scale-400;
175170
height: globals.$ion-scale-400;
176171

core/src/components/badge/badge.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class Badge implements ComponentInterface {
8080
const theme = getIonTheme(this);
8181
const { size } = this;
8282

83-
// TODO(ROU-10747): Remove theme check when sizes are defined for all themes.
83+
// TODO(FW-6355): Remove theme check when sizes are defined for all themes.
8484
if (theme !== 'ionic') {
8585
return undefined;
8686
}
@@ -133,6 +133,7 @@ export class Badge implements ComponentInterface {
133133
[`badge-vertical-${this.vertical}`]: this.vertical !== undefined,
134134
'in-button': hostContext('ion-button', this.el),
135135
'in-tab-button': hostContext('ion-tab-button', this.el),
136+
'long-badge': (this.el.textContent?.trim().length ?? 0) > 2,
136137
})}
137138
>
138139
<slot></slot>

core/src/components/badge/test/hint/badge.e2e.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,13 @@ configs({ directions: ['ltr'], modes: ['md', 'ios', 'ionic-md'] }).forEach(({ co
5656

5757
await expect(container).toHaveScreenshot(screenshot(`badge-hint-button-bottom`));
5858
});
59+
60+
test('should not have visual regressions for different button sizes', async ({ page }) => {
61+
await page.goto('/src/components/badge/test/hint', config);
62+
63+
const container = page.locator('#button-size');
64+
65+
await expect(container).toHaveScreenshot(screenshot(`badge-hint-button-size`));
66+
});
5967
});
6068
});
68 Bytes
30 Bytes
87 Bytes
4.57 KB
6.67 KB
5.52 KB
6.26 KB

0 commit comments

Comments
 (0)