-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathheader.ios.scss
More file actions
171 lines (146 loc) · 4.81 KB
/
header.ios.scss
File metadata and controls
171 lines (146 loc) · 4.81 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
@import "./header";
@import "./header.ios.vars";
// iOS Header
// --------------------------------------------------
.header-ios ion-toolbar:last-of-type {
--border-width: 0 0 #{$hairlines-width};
}
@supports (backdrop-filter: blur(0)) {
.header-background {
@include position(0, 0, 0, 0);
position: absolute;
backdrop-filter: $header-ios-translucent-filter;
}
.header-translucent-ios ion-toolbar {
--opacity: .8;
}
/**
* Disable the saturation otherwise it distorts the content
* background color when large header is not collapsed
*/
.header-collapse-condense-inactive .header-background {
backdrop-filter: blur($header-ios-blur);
}
}
.header-ios.ion-no-border ion-toolbar:last-of-type {
--border-width: 0;
}
// iOS Header - Collapse Fade
// --------------------------------------------------
.header-collapse-fade ion-toolbar {
--opacity-scale: inherit;
}
/**
* Override styles applied during the page transition to prevent
* header flickering.
*/
.header-collapse-fade.header-transitioning ion-toolbar {
--background: transparent;
--border-style: none;
}
// iOS Header - Collapse Condense
// --------------------------------------------------
.header-collapse-condense {
z-index: 9;
}
.header-collapse-condense ion-toolbar {
position: sticky;
top: 0;
}
.header-collapse-condense ion-toolbar:first-of-type {
/**
* The toolbar that contains the collapsible
* large title should not have safe area padding applied.
*/
padding-top: 0px;
z-index: 1;
}
/**
* Large title toolbar should just use the content background
* since it needs to blend in with the header above it.
*/
.header-collapse-condense ion-toolbar {
z-index: 0;
}
.header-collapse-condense ion-toolbar:last-of-type {
--border-width: 0px;
}
.header-collapse-condense ion-toolbar ion-searchbar {
padding-top: 0px;
padding-bottom: 13px;
}
.header-collapse-main {
--opacity-scale: 1;
}
.header-collapse-main ion-toolbar {
--opacity-scale: inherit;
}
.header-collapse-main ion-toolbar.in-toolbar ion-title,
.header-collapse-main ion-toolbar.in-toolbar ion-buttons {
transition: all 0.2s ease-in-out;
}
/**
* Large title toolbar should just use the content background
* since it needs to blend in with the header above it.
*/
.header-collapse-condense ion-toolbar,
/**
* Override styles applied during the page transition to prevent
* header flickering.
*/
.header-collapse-condense-inactive.header-transitioning:not(.header-collapse-condense) ion-toolbar {
--background: var(--ion-background-color, #fff);
}
/**
* Override styles applied during the page transition to prevent
* header flickering.
*/
.header-collapse-condense-inactive.header-transitioning:not(.header-collapse-condense) ion-toolbar {
--border-style: none;
--opacity-scale: 1;
}
.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-title,
.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-buttons.buttons-collapse {
opacity: 0;
pointer-events: none;
}
/**
* There is a bug in Safari where changing
* the opacity of an element in a scrollable container
* while rubber-banding causes the scroll position
* to jump to the top
*/
.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-title,
.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-buttons.buttons-collapse {
visibility: hidden;
}
/**
* The main header is only hidden once the collapsible large
* title is configured. As a result, if the main header loads
* before the collapsible large title is configured then the
* main header will be visible briefly before being hidden
* by the collapsible large title.
*
* The following selector ensures that any main header
* on a page with a collapsible large title is hidden
* before the collapsible large title is configured.
* Once the collapsible large title is configured the main
* header will have the ".header-collapse-main" class, and
* this selector will no longer apply.
*
* The :has(...) part of the selector ensures a couple things:
* 1. This will only apply within a page view since the content
* must be a subsequent-sibling of the header (~ ion-content).
* 2. This will only apply when that content has a collapse header (ion-header[collapse="condense"])
*
* We use opacity: 0 to avoid a layout shift.
* We target both the attribute and the class in the event that the attribute
* is not reflected on the host in some frameworks.
*
* Both headers should be scoped to iOS mode otherwise an MD app that uses an
* iOS header may cause other MD headers to be unexpectedly hidden.
*/
ion-header.header-ios:not(.header-collapse-main):has(~ ion-content ion-header.header-ios[collapse="condense"],
~ ion-content ion-header.header-ios.header-collapse-condense) {
opacity: 0;
}