Skip to content

Commit e07af30

Browse files
CR
1 parent 1a2d251 commit e07af30

22 files changed

+26
-33
lines changed

core/src/components/tab-button/tab-button.ionic.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@
7272
height: globals.$ion-scale-600;
7373
}
7474

75-
// Toast Shapes
75+
// Tab Button Shapes
7676
// -------------------------------------------------------------------------------
7777

78-
:host(.toast-shape-soft) {
79-
border-radius: #{globals.$ion-border-radius-200};
78+
:host(.tab-button-shape-soft) {
79+
@include globals.border-radius(globals.$ion-border-radius-200);
8080
}
8181

82-
:host(.toast-shape-round) {
83-
border-radius: #{globals.$ion-border-radius-400};
82+
:host(.tab-button-shape-round) {
83+
@include globals.border-radius(globals.$ion-border-radius-400);
8484
}
8585

86-
:host(.toast-shape-rectangular) {
87-
border-radius: #{globals.$ion-border-radius-0};
86+
:host(.tab-button-shape-rectangular) {
87+
@include globals.border-radius(globals.$ion-border-radius-0);
8888
}

core/src/components/tab-button/tab-button.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ export class TabButton implements ComponentInterface, AnchorInterface {
117117
}
118118

119119
private getShape(): string | undefined {
120+
const theme = getIonTheme(this);
120121
const { shape } = this;
121122

122123
// TODO(ROU-11300): Remove theme check when shapes are defined for all themes.
123-
if (getIonTheme(this) !== 'ionic') {
124+
if (theme !== 'ionic') {
124125
return undefined;
125126
}
126127

@@ -189,7 +190,7 @@ export class TabButton implements ComponentInterface, AnchorInterface {
189190
[`tab-layout-${layout}`]: true,
190191
'ion-activatable': true,
191192
'ion-selectable': true,
192-
[`toast-shape-${shape}`]: shape !== undefined,
193+
[`tab-button-shape-${shape}`]: shape !== undefined,
193194
'ion-focusable': true,
194195
}}
195196
>

core/src/components/tab-button/test/shape/index.html

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<title>Tab Button - Shape</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
7-
<link href="../../../../../css/core.css" rel="stylesheet" />
7+
<link rel="stylesheet" href="../../../../../css/ionic.bundle.css" />
88
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
99
<script src="../../../../../scripts/testing/scripts.js"></script>
1010
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
@@ -19,43 +19,39 @@
1919
</ion-toolbar>
2020
</ion-header>
2121

22-
<ion-content id="content" style="text-align: center">
22+
<ion-content>
2323
<ion-text>
2424
(Only available for ionic theme)
2525
</ion-text>
26-
<ion-tab-bar style="margin-top: 16px">
27-
<ion-text style="flex: 1">
28-
Default Shape
29-
</ion-text>
30-
<ion-text style="flex: 1">
31-
Soft Shape
32-
</ion-text>
33-
<ion-text style="flex: 1">
34-
Round Shape
35-
</ion-text>
36-
<ion-text style="flex: 1">
37-
Rectangular Shape
38-
</ion-text>
39-
</ion-tab-bar>
4026

4127
<ion-tab-bar>
42-
<ion-tab-button id="default-tab-button" style="background: #ff9e99">
28+
<ion-tab-button id="default-tab-button">
29+
<ion-label>Default Shape</ion-label>
4330
<ion-icon aria-hidden="true" name="stop-circle"></ion-icon>
4431
</ion-tab-button>
4532

46-
<ion-tab-button id="soft-tab-button" shape="soft" style="background: #faf19d">
33+
<ion-tab-button id="soft-tab-button" shape="soft">
34+
<ion-label>Soft Shape</ion-label>
4735
<ion-icon aria-hidden="true" name="cloud"></ion-icon>
4836
</ion-tab-button>
4937

50-
<ion-tab-button id="round-tab-button" shape="round" style="background: #ff9e99">
38+
<ion-tab-button id="round-tab-button" shape="round">
39+
<ion-label>Round Shape</ion-label>
5140
<ion-icon aria-hidden="true" name="stop-circle"></ion-icon>
5241
</ion-tab-button>
5342

54-
<ion-tab-button id="rect-tab-button" shape="rectangular" style="background: #a3ff85">
43+
<ion-tab-button id="rect-tab-button" shape="rectangular">
44+
<ion-label>Rectangular Shape</ion-label>
5545
<ion-icon aria-hidden="true" name="square"></ion-icon>
5646
</ion-tab-button>
5747
</ion-tab-bar>
5848
</ion-content>
49+
50+
<style>
51+
ion-tab-bar {
52+
background: #d4d4d4;
53+
}
54+
</style>
5955
</ion-app>
6056
</body>
6157
</html>

core/src/components/tab-button/test/shape/tab-button.e2e.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ config, screens
3636
await tabButtonFixture.goto(config);
3737
});
3838

39-
test('should render the default tab button', async () => {
40-
await tabButtonFixture.screenshot('shape-round', screenshot, '#default-tab-button');
41-
});
42-
4339
test('should render a soft tab button', async () => {
4440
await tabButtonFixture.screenshot('shape-soft', screenshot, '#soft-tab-button');
4541
});
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)