-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathtoolbar.ionic.scss
More file actions
118 lines (91 loc) · 3.26 KB
/
toolbar.ionic.scss
File metadata and controls
118 lines (91 loc) · 3.26 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
@use "./toolbar.common";
@use "../../themes/ionic/ionic.globals.scss" as globals;
// Ionic Toolbar
// --------------------------------------------------
:host {
--background: #{globals.$ion-bg-surface-default};
--color: #{globals.$ion-text-default};
--border-color: currentColor;
--padding-top: #{globals.$ion-space-200};
--padding-bottom: #{globals.$ion-space-200};
--padding-start: #{globals.$ion-space-200};
--padding-end: #{globals.$ion-space-200};
--min-height: #{globals.$ion-scale-1400};
}
.toolbar-container {
gap: globals.$ion-space-400;
// TODO(ROU-10853): replace this value with a layer token
z-index: 10;
}
// Toolbar: Transparent
// --------------------------------------------------
.toolbar-background {
// TODO(ROU-10853): replace this value with a layer token
z-index: -1;
}
// Toolbar: Content
// --------------------------------------------------
.toolbar-content {
flex: 1 1 auto;
min-width: 0;
}
// Toolbar: Searchbar
// --------------------------------------------------
:host(.toolbar-searchbar) ::slotted(ion-searchbar) {
@include globals.padding(0);
}
// Toolbar: Buttons
// --------------------------------------------------
::slotted(ion-buttons) {
gap: globals.$ion-space-200;
}
// Toolbar: Title
// --------------------------------------------------
::slotted(ion-title) {
@include globals.padding-horizontal(globals.$ion-space-200);
}
:host(.toolbar-title-default) ::slotted(ion-title) {
text-align: center;
}
:host(.toolbar-title-large) ::slotted(ion-title) {
@include globals.padding-horizontal(globals.$ion-space-400);
}
// Ionic Toolbar Slot Placement
// --------------------------------------------------
// We're using the slots to force the main toolbar content to be
// centered in the toolbar. This is a bit of a hack but it works.
// The main content is placed in the center and then JavaScript evaluates
// the sizes of the different slots and sets what size the pairs should be
// based on the larger one. We then use `flex-basis` to set the expected
// size of the slots and disable `flex-shrink` so that the smaller slot cannot
// shrink and throw off the center, we also disable flex-grow so that slots do
// not grow more than they need. The slots are paired up so the mirroring slots
// always have the same size. That is, start and end are paired and primary
// and secondary are paired. All of this works together to force the main
// content to maintain the center as best as CSS allows while also allowing
// the slots and main content to have fairly dynamic widths.
// --------------------------------------------------
:host(.has-end-content) slot[name="end"],
:host(.show-end) slot[name="end"] {
display: flex;
flex: 0 0 var(--start-end-size, 0);
justify-content: flex-end;
text-align: end;
}
:host(.has-start-content) slot[name="start"],
:host(.show-start) slot[name="start"] {
display: flex;
flex: 0 0 var(--start-end-size, 0);
}
:host(.has-primary-content) slot[name="primary"],
:host(.show-primary) slot[name="primary"] {
display: flex;
flex: 0 0 var(--primary-secondary-size, 0);
justify-content: flex-end;
text-align: end;
}
:host(.has-secondary-content) slot[name="secondary"],
:host(.show-secondary) slot[name="secondary"] {
display: flex;
flex: 0 0 var(--primary-secondary-size, 0);
}