Skip to content

Commit f8bf855

Browse files
committed
Some style adjustments after re-examining the spec
1 parent bdc1057 commit f8bf855

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

src/material-experimental/popover-edit/_popover-edit.scss

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
@import '../../lib/core/theming/theming';
44
@import '../../lib/core/typography/typography-utils';
55

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+
}
617

718
@mixin mat-edit-theme($theme) {
819
$background: map-get($theme, background);
@@ -13,17 +24,17 @@
1324

1425
.mat-row-hover-content {
1526
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);
1728
bottom: 0;
1829
display: flex;
19-
padding: 1px 4px 0;
30+
padding: 0 4px 1px;
2031
position: absolute;
2132
right: 0;
2233
top: 0;
2334
}
2435

2536
.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);
2738
left: 0;
2839
right: auto;
2940
}
@@ -32,13 +43,19 @@
3243
position: relative;
3344

3445
&:focus {
35-
border-bottom: 2px solid mat-color($primary);
46+
background: mat-edit-focus-background($primary, $background-color);
3647
outline: none;
3748

3849
.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);
4259
}
4360
}
4461
}

0 commit comments

Comments
 (0)