-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathtab-bar.ionic.scss
More file actions
140 lines (107 loc) · 3.93 KB
/
tab-bar.ionic.scss
File metadata and controls
140 lines (107 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
@use "../../themes/ionic/ionic.globals.scss" as globals;
@use "../../themes/mixins" as mixins;
@use "./tab-bar.common";
:host {
--background: #{globals.$tabbar-ionic-background};
--background-activated: #{globals.$tabbar-ionic-background-activated};
--background-focused: #{globals.$tabbar-ionic-background-focused};
--border: #{globals.$ion-border-size-0} #{globals.$ion-border-style-solid} #{globals.$tabbar-ionic-border-color};
--color: #{globals.$tabbar-ionic-color};
--color-selected: #{globals.$tabbar-ionic-color-selected};
/*
* In case there's scrolling, justify the content to the start.
*/
justify-content: unset;
/*
* Ensure the tab bar does not grow larger than the viewport width.
* Useful for when the tab buttons have large labels, allowing the space
* to be evenly divided among the buttons.
*/
max-width: 100%;
/**
* Tab bar has a box sizing of content-box to ensure the padding
* is not included in the height. This is important for the
* component to adjust to the safe area bottom.
*
* In order for the height to be calculated correctly, the padding
* top and bottom must be excluded from the height calculation.
*/
min-height: calc(globals.$ion-scale-1400 - calc(globals.$ion-space-100 * 2));
gap: globals.$ion-space-300;
box-shadow: #{globals.$ion-elevation-2};
/*
* In case there are more tab buttons than can fit in the tab bar, enable
* horizontal scrolling.
*/
overflow: auto hidden;
// TODO(ROU-10853): replace this value with a layer token
z-index: 10;
}
// Tab Bar Expand
// --------------------------------------------------
/* Full */
:host(.tab-bar-full) {
/* stylelint-disable */
padding-top: globals.$ion-space-100;
padding-bottom: calc(globals.$ion-space-100 + var(--ion-safe-area-bottom, 0));
padding-right: calc(globals.$ion-space-400 + var(--ion-safe-area-right, 0));
padding-left: calc(globals.$ion-space-400 + var(--ion-safe-area-left, 0));
/* stylelint-enable */
}
:host([slot="top"].tab-bar-full) {
padding-top: calc(globals.$ion-space-100 + var(--ion-safe-area-top, 0));
padding-bottom: globals.$ion-space-100;
}
/* Compact */
:host(.tab-bar-compact) {
@include globals.padding(globals.$ion-space-100, globals.$ion-space-400);
@include mixins.position-horizontal(50%, null);
position: absolute;
align-self: center;
width: fit-content;
transform: translateX(calc(-50%));
contain: content;
}
:host([slot="top"].tab-bar-compact) {
top: calc(globals.$ion-space-100 + var(--ion-safe-area-top, 0));
}
:host([slot="bottom"].tab-bar-compact) {
bottom: calc(globals.$ion-space-400 + var(--ion-safe-area-bottom, 0));
}
// Tab Bar Hide on Scroll
// --------------------------------------------------
:host(.tab-bar-hide-on-scroll) {
transition: transform globals.$ion-transition-time-200 globals.$ion-transition-curve-spring;
}
:host(.tab-bar-scroll-hidden) {
transform: translateY(calc(100% + var(--ion-safe-area-bottom, 0) + globals.$ion-space-1000)) translateX(calc(-50%));
transition: transform globals.$ion-transition-time-350 globals.$ion-transition-curve-base;
}
:host([slot="top"].tab-bar-scroll-hidden) {
transform: translateY(-100%) translateX(calc(-50%));
}
// Tab Bar Translucent
// --------------------------------------------------
@supports (backdrop-filter: blur(0)) {
:host(.tab-bar-translucent) {
--background: rgba(255, 255, 255, 0.6);
backdrop-filter: var(--tab-bar-backdrop-filter, blur(12px));
}
:host(.tab-bar-translucent) ::slotted(ion-tab-button.ion-focused) {
--background: transparent;
}
}
// Tab Bar Shapes
// --------------------------------------------------
/* Soft */
:host(.tab-bar-soft) {
@include globals.border-radius(globals.$ion-border-radius-400);
}
/* Round */
:host(.tab-bar-round) {
@include globals.border-radius(globals.$ion-border-radius-full);
}
/* Rectangular */
:host(.tab-bar-rectangular) {
@include globals.border-radius(globals.$ion-border-radius-0);
}