|
3 | 3 | @import '../../lib/core/theming/theming';
|
4 | 4 | @import '../../lib/core/typography/typography-utils';
|
5 | 5 |
|
| 6 | +@function mat-edit-hover-content-background($direction, $background-color) { |
| 7 | + @return linear-gradient($direction, rgba($background-color, 0), $background-color 8px); |
| 8 | +} |
| 9 | + |
| 10 | +@function mat-edit-focus-background($underline-color, $background-color) { |
| 11 | + @return linear-gradient( |
| 12 | + 0deg, |
| 13 | + mat-color($underline-color), |
| 14 | + mat-color($underline-color) 2px, |
| 15 | + $background-color 2px); |
| 16 | +} |
6 | 17 |
|
7 | 18 | @mixin mat-edit-theme($theme) {
|
8 | 19 | $background: map-get($theme, background);
|
|
13 | 24 |
|
14 | 25 | .mat-row-hover-content {
|
15 | 26 | align-items: center;
|
16 |
| - background: linear-gradient(90deg, rgba($background-color, 0), $background-color 8px); |
| 27 | + background: mat-edit-hover-content-background(90deg, $background-color); |
17 | 28 | bottom: 0;
|
18 | 29 | display: flex;
|
19 |
| - padding: 1px 4px 0; |
| 30 | + padding: 0 4px 1px; |
20 | 31 | position: absolute;
|
21 | 32 | right: 0;
|
22 | 33 | top: 0;
|
23 | 34 | }
|
24 | 35 |
|
25 | 36 | .mat-row-hover-content-rtl {
|
26 |
| - background: linear-gradient(270deg, rgba($background-color, 0), $background-color 8px); |
| 37 | + background: mat-edit-hover-content-background(270deg, $background-color); |
27 | 38 | left: 0;
|
28 | 39 | right: auto;
|
29 | 40 | }
|
|
32 | 43 | position: relative;
|
33 | 44 |
|
34 | 45 | &:focus {
|
35 |
| - border-bottom: 2px solid mat-color($primary); |
| 46 | + background: mat-edit-focus-background($primary, $background-color); |
36 | 47 | outline: none;
|
37 | 48 |
|
38 | 49 | .mat-row-hover-content {
|
39 |
| - // The bottom border is normally 1px high, so we need to adjust the position of the |
40 |
| - // hover content when the cell has focus. |
41 |
| - padding-top: 2px; |
| 50 | + background: |
| 51 | + mat-edit-focus-background($primary, transparent), |
| 52 | + mat-edit-hover-content-background(90deg, $background-color); |
| 53 | + } |
| 54 | + |
| 55 | + .mat-row-hover-content-rtl { |
| 56 | + background: |
| 57 | + mat-edit-focus-background($primary, transparent), |
| 58 | + mat-edit-hover-content-background(270deg, $background-color); |
42 | 59 | }
|
43 | 60 | }
|
44 | 61 | }
|
|
0 commit comments