forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtabs.md.scss
More file actions
195 lines (137 loc) · 4.6 KB
/
tabs.md.scss
File metadata and controls
195 lines (137 loc) · 4.6 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
@import "../../globals.md";
@import "./tabs";
// Material Design Tabs
// --------------------------------------------------
/// @prop - Background color of the tabbar
$tabs-md-background: $toolbar-md-background !default;
/// @prop - Padding on the tab button
$tabs-md-tab-padding: 8px 0 10px 0 !default;
/// @prop - Min height of the tab button
$tabs-md-tab-min-height: 5.6rem !default;
/// @prop - Font size of the inactive tab button text
$tabs-md-tab-font-size: 1.2rem !default;
/// @prop - Font weight of the tab button text
$tabs-md-tab-font-weight: normal !default;
/// @prop - Opacity of the inactive tab button
$tabs-md-tab-opacity: .7 !default;
/// @prop - Text color of the inactive tab button
$tabs-md-tab-color: rgba($toolbar-md-inactive-color, $tabs-md-tab-opacity) !default;
/// @prop - Padding of the active tab button
$tabs-md-tab-padding-active: 6px 0 10px 0 !default;
/// @prop - Font size of the active tab button text
$tabs-md-tab-font-size-active: 1.4rem !default;
/// @prop - Text color of the active tab button
$tabs-md-tab-color-active: $toolbar-md-active-color !default;
/// @prop - Margin on the tab button text
$tabs-md-tab-text-margin: 6px 0 !default;
/// @prop - Capitalization of the tab button text
$tabs-md-tab-text-capitalization: none !default;
/// @prop - Transform for the tab button text
$tabs-md-tab-text-transform: scale(.85) !default;
/// @prop - Transform origin for the tab button text
$tabs-md-tab-text-transform-origin: bottom center !default;
/// @prop - Margin on the active tab button text
$tabs-md-tab-text-margin-active: 7px 0 !default;
/// @prop - Transform for the active tab button text
$tabs-md-tab-text-transform-active: scale(1) !default;
/// @prop - Text transition for the tab button text
$tabs-md-tab-text-transition: transform 200ms ease-in-out !default;
/// @prop - Size of the tab button icon
$tabs-md-tab-icon-size: 2.4rem !default;
ion-tabbar {
background: $tabs-md-background;
}
.tab-button {
padding: $tabs-md-tab-padding;
min-height: $tabs-md-tab-min-height;
font-weight: $tabs-md-tab-font-weight;
color: $tabs-md-tab-color;
&[aria-selected=true] {
padding: $tabs-md-tab-padding-active;
font-size: $tabs-md-tab-font-size-active;
color: $tabs-md-tab-color-active;
}
}
.tab-button-text {
margin: $tabs-md-tab-text-margin;
text-transform: $tabs-md-tab-text-capitalization;
transform: $tabs-md-tab-text-transform;
transform-origin: $tabs-md-tab-text-transform-origin;
transition: $tabs-md-tab-text-transition;
}
.tab-button[aria-selected=true] .tab-button-text {
margin: $tabs-md-tab-text-margin-active;
transform: $tabs-md-tab-text-transform-active;
}
.tab-button-icon {
min-width: $tabs-md-tab-icon-size + 5;
font-size: $tabs-md-tab-icon-size;
}
[tabsLayout=icon-top] .has-icon .tab-button-text {
margin-bottom: 0;
}
[tabsLayout=icon-bottom] {
.tab-button {
padding-top: 8px;
padding-bottom: 8px;
.tab-button-text {
margin-top: 0;
}
}
}
[tabsLayout=icon-right] .tab-button,
[tabsLayout=icon-left] .tab-button {
padding-bottom: 10px;
ion-icon {
min-width: 24px;
}
}
[tabsLayout=icon-hide] .tab-button,
[tabsLayout=title-hide] .tab-button,
.tab-button.icon-only,
.tab-button.has-title-only {
padding: 6px 10px;
}
// Material Design Tab Highlight
// --------------------------------------------------
[tabsHighlight=true] {
tab-highlight {
position: absolute;
bottom: 0;
left: 0;
display: block;
width: 1px;
height: 2px;
background: $tabs-md-tab-color-active;
transform: translateZ(0);
transform-origin: 0 0;
&.animate {
transition-duration: 300ms;
}
}
&[tabsPlacement=bottom] tab-highlight {
top: 0;
}
}
// Material Design Tabs Color Mixin
// --------------------------------------------------
@mixin tabbar-md($color-name, $color-base, $color-contrast) {
ion-tabs[#{$color-name}] ion-tabbar {
background-color: $color-base;
.tab-button {
color: rgba($color-contrast, $tabs-md-tab-opacity);
}
.tab-button:hover:not(.disable-hover),
.tab-button[aria-selected=true] {
color: $color-contrast;
}
tab-highlight {
background: $color-contrast;
}
}
}
// Material Design Tabbar Color Generation
// --------------------------------------------------
@each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
@include tabbar-md($color-name, $color-base, $color-contrast);
}