UNPKG

4.52 kBSCSSView Raw
1@use '@angular/cdk';
2
3@use '../core/style/variables';
4@use '../core/style/private';
5@use '../core/style/vendor-prefixes';
6
7$tab-bar-height: 48px !default;
8$tab-animation-duration: 500ms !default;
9
10// Mixin styles for labels that are contained within the tab header.
11/// @deprecated Use `mat.tabs-tab-label` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
12/// @breaking-change 17.0.0
13@mixin tab-label {
14 height: $tab-bar-height;
15 padding: 0 24px;
16 cursor: pointer;
17 box-sizing: border-box;
18 opacity: 0.6;
19 min-width: 160px;
20 text-align: center;
21 display: inline-flex;
22 justify-content: center;
23 align-items: center;
24 white-space: nowrap;
25
26 &:focus {
27 outline: none;
28
29 &:not(.mat-tab-disabled) {
30 opacity: 1;
31 }
32 }
33
34 &.mat-tab-disabled {
35 cursor: default;
36
37 @include cdk.high-contrast(active, off) {
38 opacity: 0.5;
39 }
40 }
41
42 .mat-tab-label-content {
43 display: inline-flex;
44 justify-content: center;
45 align-items: center;
46 white-space: nowrap;
47 }
48
49 @include cdk.high-contrast(active, off) {
50 opacity: 1;
51 }
52}
53
54// The ink bar that displays under the active tab label
55/// @deprecated Use `mat.tabs-ink-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
56/// @breaking-change 17.0.0
57@mixin ink-bar {
58 $height: 2px;
59
60 @include private.private-animation-noop();
61 position: absolute;
62 bottom: 0;
63 height: $height;
64 transition: $tab-animation-duration variables.$ease-in-out-curve-function;
65
66 .mat-tab-group-inverted-header & {
67 bottom: auto;
68 top: 0;
69 }
70
71 @include cdk.high-contrast(active, off) {
72 outline: solid $height;
73 height: 0;
74 }
75}
76
77// Structural styles for a tab header. Used by both `mat-tab-header` and `mat-tab-nav-bar`.
78/// @deprecated Use `mat.tabs-paginated-tab-header` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
79/// @breaking-change 17.0.0
80@mixin paginated-tab-header {
81 .mat-tab-header {
82 display: flex;
83 overflow: hidden;
84 position: relative;
85 flex-shrink: 0;
86 }
87
88 .mat-tab-header-pagination {
89 @include vendor-prefixes.user-select(none);
90 position: relative;
91 display: none;
92 justify-content: center;
93 align-items: center;
94 min-width: 32px;
95 cursor: pointer;
96 z-index: 2;
97 -webkit-tap-highlight-color: transparent;
98 touch-action: none;
99 box-sizing: content-box;
100 background: none;
101 border: none;
102 outline: 0;
103 padding: 0;
104
105 &::-moz-focus-inner {
106 border: 0;
107 }
108
109 .mat-tab-header-pagination-controls-enabled & {
110 display: flex;
111 }
112 }
113
114 // The pagination control that is displayed on the left side of the tab header.
115 .mat-tab-header-pagination-before, .mat-tab-header-rtl .mat-tab-header-pagination-after {
116 padding-left: 4px;
117 .mat-tab-header-pagination-chevron {
118 transform: rotate(-135deg);
119 }
120 }
121
122 // The pagination control that is displayed on the right side of the tab header.
123 .mat-tab-header-rtl .mat-tab-header-pagination-before, .mat-tab-header-pagination-after {
124 padding-right: 4px;
125 .mat-tab-header-pagination-chevron {
126 transform: rotate(45deg);
127 }
128 }
129
130 .mat-tab-header-pagination-chevron {
131 border-style: solid;
132 border-width: 2px 2px 0 0;
133 height: 8px;
134 width: 8px;
135 }
136
137 .mat-tab-header-pagination-disabled {
138 box-shadow: none;
139 cursor: default;
140 }
141
142 .mat-tab-list {
143 flex-grow: 1;
144 position: relative;
145 transition: transform 500ms cubic-bezier(0.35, 0, 0.25, 1);
146 }
147}
148
149// Structural styles for the element that wraps the paginated header items.
150/// @deprecated Use `mat.tabs-paginated-tab-header-item-wrapper` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
151/// @breaking-change 17.0.0
152@mixin paginated-tab-header-item-wrapper($parent) {
153 display: flex;
154
155 // We need to set the parent here explicitly, in order to prevent the alignment
156 // from any parent tab groups from propagating down to the children when nesting.
157 [mat-align-tabs='center'] > #{$parent} & {
158 justify-content: center;
159 }
160
161 [mat-align-tabs='end'] > #{$parent} & {
162 justify-content: flex-end;
163 }
164}
165
166/// @deprecated Use `mat.tabs-paginated-tab-header-container` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
167/// @breaking-change 17.0.0
168@mixin paginated-tab-header-container {
169 display: flex;
170 flex-grow: 1;
171 overflow: hidden;
172 z-index: 1;
173}