Skip to content

Commit 68e634c

Browse files
fix(tab-bar): ui tweaks for ionic theme (#30775)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> The current UI of the tab-bar and tab-button in the ionic theme is not matching the expected, in edge use cases: - tab-button: - Long label: causes the size of the tab-button to increase and eventually making other tab-buttons, not visible. - size: in different scenarios the size of each tab-button could become different. - tab-bar: - Many tab-buttons: would case some of them to become inaccessible. - Floating: distance from the bottom, was incorrect. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> The changes made allow to fix the issues described above, specifically for ionic theme, containing this way, potential impacts: - tab-button: - min-width: has been defined for the tab-button. - property was set to force each tab-button to have the same size. - tab-bar: - allow the ability for the content to overflow on the x axis - a scroll will appear if needed. - increased the distance from the bottom, to comply with latest design trends. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: Brandy Smith <[email protected]>
1 parent cac12b3 commit 68e634c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@
99
--color: #{globals.$tabbar-ionic-color};
1010
--color-selected: #{globals.$tabbar-ionic-color-selected};
1111

12+
/*
13+
* In case there's scrolling, justify the content to the start.
14+
*/
15+
justify-content: unset;
16+
17+
/*
18+
* Ensure the tab bar does not grow larger than the viewport width.
19+
* Useful for when the tab buttons have large labels, allowing the space
20+
* to be evenly divided among the buttons.
21+
*/
22+
max-width: 100%;
23+
1224
/**
1325
* Tab bar has a box sizing of content-box to ensure the padding
1426
* is not included in the height. This is important for the
@@ -23,6 +35,12 @@
2335

2436
box-shadow: #{globals.$ion-elevation-2};
2537

38+
/*
39+
* In case there are more tab buttons than can fit in the tab bar, enable
40+
* horizontal scrolling.
41+
*/
42+
overflow: auto hidden;
43+
2644
// TODO(ROU-10853): replace this value with a layer token
2745
z-index: 10;
2846
}
@@ -64,7 +82,7 @@
6482
}
6583

6684
:host([slot="bottom"].tab-bar-compact) {
67-
bottom: calc(globals.$ion-space-100 + var(--ion-safe-area-bottom, 0));
85+
bottom: calc(globals.$ion-space-400 + var(--ion-safe-area-bottom, 0));
6886
}
6987

7088
// Tab Bar Shapes

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
align-content: center;
1616

17+
min-width: globals.$ion-scale-1200;
18+
1719
min-height: globals.$ion-scale-1200;
1820
max-height: globals.$ion-scale-1800;
1921
}

0 commit comments

Comments
 (0)