Skip to content

Commit 5438ee9

Browse files
authored
Comment Likes: Remove the dependency on Noticons (#14784)
Currently the Noticons font is loaded solely for the purpose of displaying the "like" star from the Noticons icon set. This adds 20 kB to the total page load size when only comment likes are enabled. This commit replaces the icon character by an inline SVG used on WPCOM.
1 parent 2be4aff commit 5438ee9

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

modules/likes/style.css

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
* Like Button toolbar button, loading text & container styles
33
*/
44

5-
@font-face {
6-
font-family: Noticons;
7-
src: url(https://wordpress.com/i/noticons/Noticons.woff);
8-
}
9-
105
/* Master container */
116
#jp-post-flair {
127
padding-top: .5em;
@@ -163,19 +158,20 @@ div.sd-box {
163158
position: absolute;
164159
display: flex;
165160
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
166-
margin-top: 4px;
167161
}
168162

169163
.comment-likes-widget-placeholder::before {
170-
-webkit-font-smoothing: antialiased;
171-
font-family: "Noticons";
172-
font-size: 20px;
173-
line-height: .9;
174-
color: #5CB5D4;
175-
content: '\f408';
164+
color: #2EA2CC;
176165
width: 16px;
166+
height: 16px;
167+
content: '';
177168
display: inline-block;
178-
vertical-align: middle;
169+
position: relative;
170+
top: 3px;
171+
padding-right: 5px;
172+
background-repeat: no-repeat;
173+
background-size: 16px 16px;
174+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='0' fill='none' width='24' height='24'/%3E%3Cg%3E%3Cpath fill='%232EA2CC' d='M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304'/%3E%3C/g%3E%3C/svg%3E");
179175
}
180176

181177
.post-likes-widget-placeholder .button {
@@ -193,7 +189,7 @@ div.sd-box {
193189

194190
.comment-likes-widget-placeholder .loading {
195191
padding-left: 5px;
196-
margin-top: 2px;
192+
margin-top: 4px;
197193
align-self: center;
198194
color: #4E4E4E;
199195
}

0 commit comments

Comments
 (0)