Skip to content

Commit 34499f0

Browse files
committed
perf(ui): improve hover effect of trending tags
1 parent aadf939 commit 34499f0

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

_includes/trending-tags.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{% comment %}
2-
The trending tags list
3-
{% endcomment %}
1+
<!-- The trending tags list -->
42

53
{% assign MAX = 10 %}
64

@@ -41,7 +39,7 @@
4139
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
4240
{% for tag_name in trending_tags %}
4341
{% assign url = tag_name | slugify | url_encode | prepend: '/tags/' | append: '/' %}
44-
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
42+
<a class="post-tag btn btn-outline-primary" href="{{ url | relative_url }}">{{ tag_name }}</a>
4543
{% endfor %}
4644
</div>
4745
</div>

_sass/addon/commons.scss

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -260,20 +260,15 @@ i {
260260
}
261261

262262
.post-tag {
263-
display: inline-block;
264-
line-height: 1rem;
263+
line-height: 1.05rem;
265264
font-size: 0.85rem;
266-
background: none;
267265
border: 1px solid var(--btn-border-color);
268266
border-radius: 0.8rem;
269267
padding: 0.3rem 0.5rem;
270268
margin: 0 0.35rem 0.5rem 0;
271269

272270
&:hover {
273-
background-color: #2a408e;
274-
border-color: #2a408e;
275-
color: #ffffff;
276-
transition: none;
271+
transition: all 0.3s ease-in;
277272
}
278273
}
279274

@@ -522,7 +517,6 @@ i {
522517
display: inline-block;
523518
min-width: 2rem;
524519
text-align: center;
525-
background: var(--tag-bg);
526520
border-radius: 0.3rem;
527521
padding: 0 0.4rem;
528522
color: inherit;
@@ -531,14 +525,6 @@ i {
531525
&:not(:last-child) {
532526
margin-right: 0.2rem;
533527
}
534-
535-
&:hover {
536-
@extend %tag-hover;
537-
538-
border-bottom: none;
539-
text-decoration: none;
540-
color: #d2603a;
541-
}
542528
}
543529

544530
.rounded-10 {
@@ -678,6 +664,13 @@ i {
678664
text-align: left;
679665
}
680666

667+
/* Overwrite bootstrap outline button */
668+
.btn.btn-outline-primary {
669+
&:hover {
670+
border-color: #007bff !important;
671+
}
672+
}
673+
681674
.disabled {
682675
color: rgb(206, 196, 196);
683676
pointer-events: auto;

_sass/layout/post.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@ h1 + .post-meta {
155155

156156
.post-tags {
157157
line-height: 2rem;
158+
159+
.post-tag {
160+
background: var(--tag-bg);
161+
162+
&:hover {
163+
@extend %link-hover;
164+
@extend %tag-hover;
165+
@extend %no-bottom-border;
166+
}
167+
}
158168
}
159169

160170
.post-navigation {

0 commit comments

Comments
 (0)