Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07329da

Browse files
remmycatleebyron
authored andcommitted
fixed #1290 by removing relative position from star count (#1317)
1 parent 37195e5 commit 07329da

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

pages/src/src/StarBtn.js

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var StarBtn = React.createClass({
2929
<span className="gh-ico" />
3030
<span className="gh-text">Star</span>
3131
</a>
32+
{this.state.stars && <span className="gh-triangle" />}
3233
{this.state.stars &&
3334
<a
3435
className="gh-count"

pages/src/src/StarBtn.less

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.github-btn {
22
margin-top: -10%;
3+
display: flex;
4+
flex-direction: row;
35
}
46

5-
.gh-btn,
6-
.gh-count,
77
.gh-ico {
88
float: left;
99
}
@@ -69,32 +69,36 @@
6969
background-color: #fafafa;
7070
display: block !important;
7171
display: none;
72-
margin-left: 10px;
73-
position: relative;
7472
}
7573

7674
.gh-count:hover,
7775
.gh-count:focus {
7876
color: #4183C4;
7977
}
8078

81-
.gh-count:before,
82-
.gh-count:after {
79+
.gh-triangle {
80+
position: relative;
81+
margin-left: 11px;
82+
margin-right: -1px;
83+
}
84+
85+
.gh-triangle:before,
86+
.gh-triangle:after {
8387
border-color: transparent;
8488
border-style: solid;
8589
content: '';
8690
position: absolute;
8791
}
8892

89-
.gh-count:before{
93+
.gh-triangle:before{
9094
border-right-color: #fafafa;
9195
border-width: 8px 8px 8px 0;
9296
left: -7px;
9397
margin-top: -8px;
9498
top: 50%;
9599
}
96100

97-
.gh-count:after{
101+
.gh-triangle:after{
98102
border-right-color: #bababa;
99103
border-width: 9px 9px 9px 0;
100104
left: -8px;

0 commit comments

Comments
 (0)