Skip to content

Commit

Permalink
Optimize the tooltip position of sharing icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Feb 29, 2020
1 parent 556f85a commit b0d1f01
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions _includes/post-sharing.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@

<div class="share-wrapper">
<span class="share-label ml-1 mr-1">{{ site.data.share.label }}</span>
<span class="share-icon">
<span class="share-icons">
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
{% assign url = page.url | relative_url | prepend: site.url %}

{% for share in site.data.share.platforms %}
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
title="{{ share.type }}" target="_blank">
<i class="fa-fw {{ share.icon }} mr-1"></i>
<i class="fa-fw {{ share.icon }}"></i>
</a>
{% endfor %}

<i class="fa-fw fas fa-link mr-1 small" onclick="copyLink()"
<i class="fa-fw fas fa-link small" onclick="copyLink()"
data-toggle="tooltip" data-placement="top" title="Copy link"></i>

</span>
Expand Down
24 changes: 16 additions & 8 deletions assets/css/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,24 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
.share-wrapper {
vertical-align: middle;
user-select: none;
.share-icon {
.share-icons {
font-size: 1.2rem;
a:hover {
text-decoration: none;
>i {
@extend %btn-share-hovor;
a {
&:not(:last-child) {
margin-right: .25rem;
}
&:hover {
text-decoration: none;
>i {
@extend %btn-share-hovor;
}
}
}
i:hover {
@extend %btn-share-hovor;
>i {
padding-top: .35rem;
&:hover {
@extend %btn-share-hovor;
}
}
.fab {
&.fa-twitter {
Expand All @@ -242,7 +250,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
}
}

} // .share-icon
} // .share-icons

.fas.fa-link {
@include btn-sharing-color(rgb(171, 171, 171));
Expand Down

0 comments on commit b0d1f01

Please sign in to comment.