refactor: align the position of the share buttons

This commit is contained in:
Cotes Chung 2023-11-08 01:16:00 +08:00
parent 4a7f33f7bb
commit 06f1c6f256
No known key found for this signature in database
GPG Key ID: 0D9E54843167A808
2 changed files with 9 additions and 19 deletions

View File

@ -8,15 +8,13 @@
{% assign url = page.url | absolute_url | url_encode %} {% assign url = page.url | absolute_url | url_encode %}
{% for share in site.data.share.platforms -%} {% for share in site.data.share.platforms -%}
{%- capture tooltip -%}
data-bs-toggle="tooltip" data-bs-placement="top" title="{{ share.type }}" aria-label="{{ share.type }}"
{%- endcapture -%}
{% if share.type == 'Mastodon' %} {% if share.type == 'Mastodon' %}
<script defer type="module" src="https://cdn.jsdelivr.net/npm/@justinribeiro/share-to-mastodon/+esm"></script> <script defer type="module" src="https://cdn.jsdelivr.net/npm/@justinribeiro/share-to-mastodon/+esm"></script>
<button <button class="btn text-start" {{ tooltip }}>
class="btn text-start"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="{{ share.type }}"
aria-label="{{ share.type }}"
>
<share-to-mastodon <share-to-mastodon
class="share-mastodon" class="share-mastodon"
message="{{ title }}" message="{{ title }}"
@ -25,7 +23,7 @@
customInstanceList="{{ share.instances | jsonify | xml_escape }}" customInstanceList="{{ share.instances | jsonify | xml_escape }}"
{%- endif %} {%- endif %}
> >
<i class="{{ share.icon }}"></i> <i class="fa-fw {{ share.icon }}"></i>
</share-to-mastodon> </share-to-mastodon>
</button> </button>
@ -34,15 +32,7 @@
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %} {% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
<a <a href="{{ link }}" target="_blank" rel="noopener" {{ tooltip }}>
href="{{ link }}"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="{{ share.type }}"
target="_blank"
rel="noopener"
aria-label="{{ share.type }}"
>
<i class="fa-fw {{ share.icon }}"></i> <i class="fa-fw {{ share.icon }}"></i>
</a> </a>
{% endfor %} {% endfor %}

View File

@ -90,9 +90,9 @@ h1 + .post-meta {
} }
button { button {
position: relative;
bottom: 1px;
padding: 0; padding: 0;
border: none;
line-height: inherit;
@extend %cursor-pointer; @extend %cursor-pointer;
} }