Skip to content

Commit 06f1c6f

Browse files
committed
refactor: align the position of the share buttons
1 parent 4a7f33f commit 06f1c6f

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

_includes/post-sharing.html

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
{% assign url = page.url | absolute_url | url_encode %}
99

1010
{% for share in site.data.share.platforms -%}
11+
{%- capture tooltip -%}
12+
data-bs-toggle="tooltip" data-bs-placement="top" title="{{ share.type }}" aria-label="{{ share.type }}"
13+
{%- endcapture -%}
14+
1115
{% if share.type == 'Mastodon' %}
1216
<script defer type="module" src="https://cdn.jsdelivr.net/npm/@justinribeiro/share-to-mastodon/+esm"></script>
13-
<button
14-
class="btn text-start"
15-
data-bs-toggle="tooltip"
16-
data-bs-placement="top"
17-
title="{{ share.type }}"
18-
aria-label="{{ share.type }}"
19-
>
17+
<button class="btn text-start" {{ tooltip }}>
2018
<share-to-mastodon
2119
class="share-mastodon"
2220
message="{{ title }}"
@@ -25,7 +23,7 @@
2523
customInstanceList="{{ share.instances | jsonify | xml_escape }}"
2624
{%- endif %}
2725
>
28-
<i class="{{ share.icon }}"></i>
26+
<i class="fa-fw {{ share.icon }}"></i>
2927
</share-to-mastodon>
3028
</button>
3129

@@ -34,15 +32,7 @@
3432

3533
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
3634

37-
<a
38-
href="{{ link }}"
39-
data-bs-toggle="tooltip"
40-
data-bs-placement="top"
41-
title="{{ share.type }}"
42-
target="_blank"
43-
rel="noopener"
44-
aria-label="{{ share.type }}"
45-
>
35+
<a href="{{ link }}" target="_blank" rel="noopener" {{ tooltip }}>
4636
<i class="fa-fw {{ share.icon }}"></i>
4737
</a>
4838
{% endfor %}

_sass/layout/post.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ h1 + .post-meta {
9090
}
9191

9292
button {
93-
position: relative;
94-
bottom: 1px;
9593
padding: 0;
94+
border: none;
95+
line-height: inherit;
9696

9797
@extend %cursor-pointer;
9898
}

0 commit comments

Comments
 (0)