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