/
_popover-edit-theme.scss
178 lines (150 loc) · 4.52 KB
/
_popover-edit-theme.scss
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
@use 'sass:map';
@use '@angular/cdk';
@use '@angular/material' as mat;
@function _hover-content-background($direction, $background-color) {
@return linear-gradient($direction, rgba($background-color, 0), $background-color 8px);
}
@mixin color($config-or-theme) {
$config: mat.get-color-config($config-or-theme);
$background: map.get($config, background);
$foreground: map.get($config, foreground);
$primary: map.get($config, primary);
$background-color: mat.get-color-from-palette($background, 'card');
// TODO: these structural styles don't belong in the `color` part of a theme.
// We should figure out a better place for them.
.mat-row-hover-content-host-cell {
position: relative;
}
.mat-row-hover-content {
align-items: center;
background: _hover-content-background(90deg, $background-color);
bottom: 0;
display: flex;
opacity: 0;
padding: 0 4px 1px;
position: absolute;
right: 0;
top: 0;
transition: opacity mat.$private-swift-ease-in-duration
mat.$private-swift-ease-in-timing-function;
}
.mat-row-hover-content-rtl {
background: _hover-content-background(270deg, $background-color);
left: 0;
right: auto;
}
.mat-row-hover-content-visible {
opacity: 1;
}
.mat-popover-edit-cell {
position: relative;
&::after {
background-color: mat.get-color-from-palette($primary);
bottom: 0;
content: '';
height: 2px;
left: 0;
opacity: 0;
position: absolute;
right: 0;
transform-origin: 50%;
transform: scaleX(0.5);
transition: background-color mat.$private-swift-ease-in-duration
mat.$private-swift-ease-in-timing-function;
visibility: hidden;
}
&:focus {
outline: none;
&::after {
opacity: 1;
transform: scaleX(1);
transition: transform 300ms mat.$private-swift-ease-out-timing-function,
opacity 100ms mat.$private-swift-ease-out-timing-function,
background-color 300ms mat.$private-swift-ease-out-timing-function;
visibility: visible;
@include cdk.high-contrast {
border-bottom: 3px dashed black;
}
}
}
}
.mat-edit-pane {
@include mat.private-theme-elevation(2, $config);
background: $background-color;
color: mat.get-color-from-palette($foreground, text);
display: block;
padding: 16px 24px;
@include cdk.high-contrast(active, off) {
// Note that normally we use 1px for high contrast outline, however here we use 3,
// because the popover is rendered on top of a table which already has some borders
// and doesn't have a backdrop. The thicker outline makes it easier to differentiate.
outline: solid 3px;
}
}
.mat-edit-lens {
display: block;
width: 100%;
}
[mat-edit-title] {
display: block;
margin: 0;
}
[mat-edit-content],
[mat-edit-fill] {
display: block;
mat-form-field {
display: block;
// Clear the top padding, because we don't have a label on it and the reserved space
// can throw off the alignment when there isn't a header (see discussion in #17600).
&:not(.mat-form-field-has-label) .mat-form-field-infix {
padding-top: 0;
}
}
// Make mat-selection-lists inside of the look more like mat-select popups.
mat-selection-list {
max-height: 256px; // Same as mat-select.
overflow-y: auto;
}
}
[mat-edit-fill] {
margin: -16px -24px;
mat-selection-list:first-child {
padding-top: 0;
}
}
[mat-edit-actions] {
align-items: center;
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
margin: 8px -16px -8px;
}
[mat-edit-fill] + [mat-edit-actions] {
margin-top: 16px;
}
}
@mixin typography($config-or-theme) {
$config: mat.private-typography-to-2014-config(
mat.get-typography-config($config-or-theme));
[mat-edit-title] {
@include mat.typography-level($config, title);
}
}
@mixin density($config-or-theme) {}
@mixin theme($theme-or-color-config) {
$theme: mat.private-legacy-get-theme($theme-or-color-config);
@include mat.private-check-duplicate-theme-styles($theme, 'mat-popover-edit') {
$color: mat.get-color-config($theme);
$density: mat.get-density-config($theme);
$typography: mat.get-typography-config($theme);
@if $color != null {
@include color($color);
}
@if $density != null {
@include density($density);
}
@if $typography != null {
@include typography($typography);
}
}
}