Repository navigation
Expand file tree
/
Copy pathrecent-commits.less
More file actions
127 lines (106 loc) · 2.81 KB
/
Copy pathrecent-commits.less
File metadata and controls
127 lines (106 loc) · 2.81 KB
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
@import "variables";
// Recents commits
// Shown under the commit message input
@size: 16px; // make sure to double the size of the avatar in recent-commits-view.js to make it look crisp
@show-max: 3; // how many commits should be shown
.github-RecentCommits {
// Fit @show-max + 1px for the top border
max-height: @show-max * @size + @component-padding * @show-max + @component-padding + 1px;
overflow-x: hidden;
overflow-y: auto;
border-top: 1px solid @base-border-color;
&-list {
margin: 0;
padding: @component-padding/2 0;
list-style: none;
}
&-message {
padding: @component-padding/2 @component-padding;
text-align: center;
color: @text-color-subtle;
}
}
.github-RecentCommit {
position: relative;
display: flex;
align-items: center;
padding: 0 @component-padding;
line-height: @size + @component-padding;
&-authors {
position: absolute;
display: flex;
}
&-avatar {
position: relative;
margin-right: -@size + 3px;
width: @size;
height: @size;
border-radius: @component-border-radius;
color: transparent;
background-color: mix(@text-color, @base-background-color, 15%);
box-shadow: 1px 0 @base-background-color;
overflow: hidden;
transition: margin .12s cubic-bezier(.5,.1,0,1);
&:nth-child(1) { z-index: 3; }
&:nth-child(2) { z-index: 2; opacity: .7; }
&:nth-child(3) { z-index: 1; opacity: .4; }
&:nth-child(n+4) {
display: none;
}
&:only-child,
&:last-child {
box-shadow: none;
}
}
&-authors:hover .github-RecentCommit-avatar {
display: inline-block;
margin-right: 1px;
opacity: 1;
}
&-message {
flex: 1;
margin: 0 .5em;
margin-left: @size + @component-padding;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
&-undoButton.btn {
padding: 0 @component-padding/1.5;
margin-right: @component-padding/2;
height: @size * 1.25;
line-height: 1;
font-size: .9em;
}
&-time {
color: @text-color-subtle;
}
&:hover {
color: @text-color-highlight;
background: @background-color-highlight;
}
&.is-selected {
// is selected
color: @text-color-selected;
background: @background-color-selected;
// also has focus
.github-RecentCommits:focus & {
color: contrast(@button-background-color-selected);
background: @button-background-color-selected;
}
}
}
// Responsive
// Show more commits if window height gets larger
@media (min-height: 900px) {
.github-RecentCommits {
@show-max: 5;
max-height: @show-max * @size + @component-padding * @show-max + @component-padding + 1px;
}
}
@media (min-height: 1200px) {
.github-RecentCommits {
@show-max: 10;
max-height: @show-max * @size + @component-padding * @show-max + @component-padding + 1px;
}
}