Skip to content

Commit 3a7addf

Browse files
committed
feat(toolbar): control toolbar borders on top/bottom
Toolbars can be stacked up vertically in `<ion-header>`, `<ion-content>`, and `<ion-footer>` elements. However, toolbars also come with borders on both the top and bottom of the toolbar. To give developers full control of the design, Ionic also includes the `no-border-bottom` and `no-border-top` attributes. For example, sometimes two vertically stacked toolbars may have different background colors, in this case it might be best to leave a border between them. However, if they have the same background color, the app may look best without a border between them. The main point here is, it's entirely up to the app's design to decide when and when not to show borders between toolbars, and to do so then each toolbar can individually set `no-border-bottom` and `no-border-top` attributes.
1 parent a1223da commit 3a7addf

File tree

16 files changed

+88
-55
lines changed

16 files changed

+88
-55
lines changed

src/animations/animation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class Animation {
6868
var i: number;
6969

7070
if (ele) {
71-
if (Array.isArray(ele)) {
71+
if (ele.length) {
7272
for (i = 0; i < ele.length; i++) {
7373
this._addEle(ele[i]);
7474
}

src/components/app/test/cordova/page1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</button>
1919
</ion-navbar>
2020

21-
<ion-toolbar>
21+
<ion-toolbar no-border-top>
2222
<ion-title>I'm a toolbar</ion-title>
2323
</ion-toolbar>
2424

src/components/app/test/cordova/page2.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ion-header>
22

3-
<ion-navbar>
3+
<ion-navbar no-border-bottom>
44
<ion-title>Page 2</ion-title>
55
<button menuToggle>
66
<ion-icon name="menu"></ion-icon>
@@ -15,8 +15,8 @@
1515
</button>
1616
</ion-navbar>
1717

18-
<ion-toolbar>
19-
<ion-title>I'm a toolbar</ion-title>
18+
<ion-toolbar no-border-top>
19+
Hello, I am a sub header, with no border on top
2020
</ion-toolbar>
2121

2222
</ion-header>

src/components/app/z-index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $z-index-refresher: 0;
1515
$z-index-page-container: 0;
1616
$z-index-selected-tab: 1;
1717
$z-index-toolbar: 10;
18-
$z-index-toolbar-background: 0;
18+
$z-index-toolbar-background: -1;
1919

2020
$z-index-backdrop: 2;
2121
$z-index-overlay-wrapper: 10;

src/components/modal/test/basic/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class ModalPassData {
188188
<ion-title>Toolbar 1</ion-title>
189189
</ion-toolbar>
190190
191-
<ion-toolbar>
191+
<ion-toolbar no-border-top>
192192
<ion-title>Toolbar 2</ion-title>
193193
</ion-toolbar>
194194
</ion-header>

src/components/nav/test/basic/index.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ class FullPage {
209209
<button>S1g</button>
210210
</ion-buttons>
211211
</ion-navbar>
212+
<ion-toolbar no-border-top>
213+
<ion-title>I'm a sub header!</ion-title>
214+
</ion-toolbar>
212215
</ion-header>
213216
214217
<ion-content padding>
@@ -227,8 +230,11 @@ class FullPage {
227230
</ion-content>
228231
229232
<ion-footer>
230-
<ion-toolbar>
231-
Footer
233+
<ion-toolbar no-border-bottom>
234+
I'm a sub footer!
235+
</ion-toolbar>
236+
<ion-toolbar no-border-top>
237+
<ion-title>Footer</ion-title>
232238
</ion-toolbar>
233239
</ion-footer>
234240
`
@@ -281,6 +287,11 @@ class PrimaryHeaderPage {
281287
</ion-header>
282288
283289
<ion-content>
290+
291+
<ion-toolbar no-border-top>
292+
I'm a sub header in the content!
293+
</ion-toolbar>
294+
284295
<ion-list>
285296
286297
<ion-item>
@@ -296,7 +307,17 @@ class PrimaryHeaderPage {
296307
<button ion-item (click)="setRoot()">setRoot(FirstPage)</button>
297308
<button ion-item (click)="toggleBackButton()">Toggle hideBackButton</button>
298309
<button ion-item (click)="setBackButtonText()">Set Back Button Text</button>
310+
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
299311
</ion-list>
312+
313+
<ion-toolbar no-border-bottom>
314+
I'm a sub footer in the content!
315+
</ion-toolbar>
316+
317+
<ion-toolbar no-border-bottom no-border-top>
318+
And I'm a sub footer in the content too!
319+
</ion-toolbar>
320+
300321
</ion-content>
301322
302323
<ion-footer>

src/components/searchbar/test/nav/search.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<ion-header>
22

3-
<ion-navbar>
3+
<ion-navbar no-border-bottom>
44
<ion-title>Searchbar</ion-title>
55
</ion-navbar>
66

7-
<ion-toolbar>
7+
<ion-toolbar no-border-top>
88
<ion-searchbar primary (ionInput)="getItems($event)" placeholder="Filter Schedules">
99
</ion-searchbar>
1010
</ion-toolbar>

src/components/segment/test/basic/main.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ion-header>
22

3-
<ion-toolbar>
3+
<ion-toolbar no-border-bottom>
44
<ion-segment id="segment" [(ngModel)]="relationship" (ionChange)="onSegmentChanged($event)">
55
<ion-segment-button value="friends" (ionSelect)="onSegmentSelected($event)" class="e2eSegmentFriends">
66
Friends
@@ -11,7 +11,7 @@
1111
</ion-segment>
1212
</ion-toolbar>
1313

14-
<ion-toolbar>
14+
<ion-toolbar no-border-top>
1515
<ion-buttons end>
1616
<button>
1717
<ion-icon name="search"></ion-icon>
@@ -117,7 +117,7 @@ <h4>Model style: NgModel</h4>
117117
</ion-segment>
118118
</ion-toolbar>
119119

120-
<ion-toolbar>
120+
<ion-toolbar no-border-top no-border-bottom>
121121
<ion-segment [(ngModel)]="appType" danger>
122122
<ion-segment-button value="paid">
123123
Default
@@ -131,7 +131,7 @@ <h4>Model style: NgModel</h4>
131131
</ion-segment>
132132
</ion-toolbar>
133133

134-
<ion-toolbar>
134+
<ion-toolbar no-border-top>
135135
<ion-segment [(ngModel)]="appType" dark [disabled]="isDisabled">
136136
<ion-segment-button value="paid">
137137
Default

src/components/segment/test/nav/main.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<ion-header>
22

3-
<ion-navbar>
3+
<ion-navbar no-border-bottom>
44
<ion-title>
55
Segment under Navbar
66
</ion-title>
77
</ion-navbar>
88

9-
<ion-toolbar>
9+
<ion-toolbar no-border-top>
1010
<ion-segment [(ngModel)]="signInType">
1111
<ion-segment-button value="new">
1212
New

src/components/segment/test/swipe/main.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<ion-header>
22

3-
<ion-navbar>
3+
<ion-navbar no-border-bottom>
44
<ion-title>
55
Segment Swipeable under Navbar
66
</ion-title>
77
</ion-navbar>
88

9-
<ion-toolbar>
9+
<ion-toolbar no-border-top>
1010
<ion-segment [(ngModel)]="selectedSegment" (ionChange)="onSegmentChanged($event)">
1111
<ion-segment-button value="first">
1212
First

0 commit comments

Comments
 (0)