Skip to content

Commit

Permalink
perf(ui): improve hover effect of trending tags
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed May 12, 2023
1 parent aadf939 commit 34499f0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
6 changes: 2 additions & 4 deletions _includes/trending-tags.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% comment %}
The trending tags list
{% endcomment %}
<!-- The trending tags list -->

{% assign MAX = 10 %}

Expand Down Expand Up @@ -41,7 +39,7 @@
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
{% for tag_name in trending_tags %}
{% assign url = tag_name | slugify | url_encode | prepend: '/tags/' | append: '/' %}
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
<a class="post-tag btn btn-outline-primary" href="{{ url | relative_url }}">{{ tag_name }}</a>
{% endfor %}
</div>
</div>
Expand Down
25 changes: 9 additions & 16 deletions _sass/addon/commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,15 @@ i {
}

.post-tag {
display: inline-block;
line-height: 1rem;
line-height: 1.05rem;
font-size: 0.85rem;
background: none;
border: 1px solid var(--btn-border-color);
border-radius: 0.8rem;
padding: 0.3rem 0.5rem;
margin: 0 0.35rem 0.5rem 0;

&:hover {
background-color: #2a408e;
border-color: #2a408e;
color: #ffffff;
transition: none;
transition: all 0.3s ease-in;
}
}

Expand Down Expand Up @@ -522,7 +517,6 @@ i {
display: inline-block;
min-width: 2rem;
text-align: center;
background: var(--tag-bg);
border-radius: 0.3rem;
padding: 0 0.4rem;
color: inherit;
Expand All @@ -531,14 +525,6 @@ i {
&:not(:last-child) {
margin-right: 0.2rem;
}

&:hover {
@extend %tag-hover;

border-bottom: none;
text-decoration: none;
color: #d2603a;
}
}

.rounded-10 {
Expand Down Expand Up @@ -678,6 +664,13 @@ i {
text-align: left;
}

/* Overwrite bootstrap outline button */
.btn.btn-outline-primary {
&:hover {
border-color: #007bff !important;
}
}

.disabled {
color: rgb(206, 196, 196);
pointer-events: auto;
Expand Down
10 changes: 10 additions & 0 deletions _sass/layout/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ h1 + .post-meta {

.post-tags {
line-height: 2rem;

.post-tag {
background: var(--tag-bg);

&:hover {
@extend %link-hover;
@extend %tag-hover;
@extend %no-bottom-border;
}
}
}

.post-navigation {
Expand Down

0 comments on commit 34499f0

Please sign in to comment.