-
Notifications
You must be signed in to change notification settings - Fork 173
/
Copy path_patterns_table-sortable.scss
47 lines (39 loc) · 1.21 KB
/
_patterns_table-sortable.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
@import 'settings';
@mixin vf-p-table-sortable {
%heading-icon {
$vertical-offset: 0.5px;
@include vf-icon-chevron-themed;
@include vf-icon-size(map-get($icon-sizes, default));
background: {
repeat: no-repeat;
size: 100%;
}
content: '';
display: inline-block;
margin-left: $sp-x-small;
// table heading text is smaller than the icon, so we need to compensate with negative top margin
margin-top: calc(#{map-get($font-sizes, x-small)}rem - $default-icon-size);
vertical-align: calc($vertical-offset + 0.5 * $cap-height - 0.5 * $default-icon-size);
}
// stylelint-disable selector-max-type -- table elements can use selector types
table th {
&[aria-sort] {
align-items: center;
cursor: pointer;
white-space: nowrap;
}
&[aria-sort='ascending']::after {
@extend %heading-icon;
-webkit-transform: rotate(180deg); // stylelint-disable-line property-no-vendor-prefix
transform: rotate(180deg);
}
&[aria-sort='descending']::after {
@extend %heading-icon;
}
&[aria-sort]:hover {
color: $colors--theme--link-default;
text-decoration: underline;
}
}
// stylelint-enable selector-max-type
}