Skip to content

Commit 45dbb35

Browse files
committed
Use font icons instead of images
1 parent 35b0177 commit 45dbb35

File tree

7 files changed

+184
-13
lines changed

7 files changed

+184
-13
lines changed

assets/Entypo-webfont.eot

24.4 KB
Binary file not shown.

assets/Entypo-webfont.svg

Lines changed: 141 additions & 0 deletions
Loading

assets/Entypo-webfont.ttf

24.3 KB
Binary file not shown.

assets/Entypo-webfont.woff

15.8 KB
Binary file not shown.

assets/base.css

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
/* Github Box Header - Stats */
5151

5252
.github-box .github-box-header .github-stats {
53+
line-height: 36px;
5354
position: absolute;
5455
top: 10px;
5556
right: 10px;
@@ -66,25 +67,32 @@
6667
display: inline-block;
6768
height: 21px;
6869
color: #666;
69-
padding: 0 5px 0 18px;
70-
background: url('btn-sprite.png') no-repeat;
70+
padding: 0 5px 0 5px;
7171
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
7272
opacity: 0.7;
73+
vertical-align: top;
7374
}
7475

7576
.github-box .github-box-header .github-stats a:hover {
7677
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
7778
opacity: 1;
7879
}
7980

80-
.github-box .github-box-header .github-stats .repo-watchers {
81+
.github-box .github-box-header .github-stats a:before {
82+
font-family: 'EntypoRegular';
83+
content: attr(data-icon);
84+
display: inline-block;
85+
speak: none;
86+
padding-right: 2px;
87+
font-size: 2em;
88+
}
89+
90+
.github-box .github-box-header .github-stats .repo-stars {
8191
border-right: 1px solid #ddd;
82-
background-position: 3px 4px;
8392
}
8493

8594
.github-box .github-box-header .github-stats .repo-forks {
86-
background-position: 2px -14px;
87-
padding-left: 15px;
95+
padding-left: 2px;
8896
}
8997

9098
/* Github Box Content */
@@ -147,13 +155,12 @@
147155
border-bottom-color: #bbb;
148156
border-radius: 3px;
149157
display: block;
150-
text-indent: -9999px;
151158
width: 24px;
152159
padding: 0;
153-
background: url('btn-sprite.png') no-repeat 4px -31px,-webkit-linear-gradient(whiteSmoke, #E5E5E5);
154-
background: url('btn-sprite.png') no-repeat 4px -31px,-moz-linear-gradient(#f1f7fa, #dbeaf1);
160+
background: -webkit-linear-gradient(whiteSmoke, #E5E5E5);
161+
background: -moz-linear-gradient(#f1f7fa, #dbeaf1);
155162
filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
156-
opacity: 0.7;
163+
opacity: 1;
157164
}
158165

159166
.github-box .github-box-download .repo-download:hover {
@@ -164,6 +171,16 @@
164171
opacity: 1;
165172
}
166173

174+
.github-box .github-box-download .repo-download:before {
175+
font-family: 'EntypoRegular';
176+
text-indent: 0px;
177+
content: attr(data-icon);
178+
display: inline-block;
179+
speak: none;
180+
font-size: 2.0em;
181+
padding: 0 6px;
182+
}
183+
167184
/* Breakpoint content-driven */
168185

169186
@media all and (max-width: 678px) {
@@ -173,3 +190,16 @@
173190
margin-right: 0;
174191
}
175192
}
193+
194+
/* Fonts */
195+
196+
@font-face {
197+
font-family: 'EntypoRegular';
198+
src: url('Entypo-webfont.eot');
199+
src: url('Entypo-webfont.eot?#iefix') format('embedded-opentype'),
200+
url('Entypo-webfont.woff') format('woff'),
201+
url('Entypo-webfont.ttf') format('truetype'),
202+
url('Entypo-webfont.svg#EntypoRegular') format('svg');
203+
font-weight: normal;
204+
font-style: normal;
205+
}

assets/btn-sprite.png

-1.56 KB
Binary file not shown.

src/jquery.github.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@
108108
<a href='" + repo_url + "'>" + repo.name + "</a> \
109109
</h3> \
110110
<div class='github-stats'> \
111-
<a class='repo-watchers' href='" + repo_url + "/watchers'>" + repo.watchers + "</a> \
112-
<a class='repo-forks' href='" + repo_url + "/network'>" + repo.forks + "</a> \
111+
<a class='repo-stars' title='Stars' data-icon='7' href='" + repo_url + "/watchers'>" + repo.watchers + "</a> \
112+
<a class='repo-forks' title='Forks' data-icon='f' href='" + repo_url + "/network'>" + repo.forks + "</a> \
113113
</div> \
114114
</div> \
115115
<div class='github-box-content'> \
116116
<p>" + repo.description + " &mdash; <a href='" + repo_url + "#readme'>Read More</a></p> \
117117
</div> \
118118
<div class='github-box-download'> \
119119
<p class='repo-update'>Latest commit to <strong>master</strong> on " + pushed_at + "</p> \
120-
<a class='repo-download' href='" + repo_url + "/zipball/master'>Download as zip</a> \
120+
<a class='repo-download' title='Download as zip' data-icon='w' href='" + repo_url + "/zipball/master'></a> \
121121
</div> \
122122
</div> \
123123
") );

0 commit comments

Comments
 (0)