共有ボタンはBloggerの機能にもあるのですが、デザインや対応しているものが古い感じがするので、直接タグを編集して実装したメモ。
<style> .sns-share-buttons { text-align: center; font-size: 14px; font-family: Helvetica,"游ゴシック",YuGothic,"Hiragino Kaku Gothic ProN",Meiryo,sans-serif; } .sns-share-buttons-inner:after { content: "."; display: block; clear: both; height: 0; visibility: hidden; } .sns-share-buttons-inner{ display:flex; justify-content:space-around; } .sns-share-buttons-inner a{ box-sizing: border-box; display: block; width: 18%; padding: .7em 0; color: white; text-decoration: none; text-align: center; border-radius:6px; font-weight: bold; } .sns-share-buttons-inner a, .sns-share-buttons-inner a:link, .sns-share-buttons-inner a:visited, .sns-share-buttons-inner a:hover, .sns-share-buttons-inner a:active, .sns-share-buttons-inner a:focus{ color: white !important; } .sns-btn.sns-btn-twitter{ background: #1B95E0; } .sns-btn.sns-btn-line{ background: #1dcd00; } .sns-btn.sns-btn-facebook{ background: #3b5998; } .sns-btn.sns-btn-pocket{ background: #ee4056; } .sns-btn.sns-btn-hatena{ background: #008FDE; } .sns-btn { -webkit-transition: 0.3s ease-in-out; -moz-transition: 0.3s ease-in-out; -o-transition: 0.3s ease-in-out; transition: 0.3s ease-in-out; } .sns-btn:hover { opacity: 0.6; filter: alpha(opacity=60); } /* 画面サイズが768px以上の時 */ @media only screen and (min-width: 768px) { .sns-btn::after { font-weight: bold; margin-left: 0.25em; } .sns-btn.sns-btn-facebook::after{ content: 'Facebook'; } .sns-btn.sns-btn-line::after{ content: 'LINE'; } .sns-btn.sns-btn-twitter::after{ content: 'Twitter'; } .sns-btn.sns-btn-pocket::after{ content: 'Pocket'; } .sns-btn.sns-btn-hatena::after{ content: 'Hatena'; } } </style>
アイコンにFont Awesomeを使うのでkitを作成してこちらも貼り付け。
Font Awesome
The internet's icon library + toolkit. Used by millions of designers, devs, & content creators. Open-source. Always free. Always awesome.
<script crossorigin='anonymous' src='https://kit.fontawesome.com/0123456789.js'/>
(※以下のコードはサンプルです。)
<div class='sns-share-buttons'> <h4 style='text-align:center;'>Shareボタン</h4> <div class='sns-share-buttons-inner'> <!-- Twitter --> <a class='sns-btn sns-btn-twitter' expr:href='"http://twitter.com/share?url=" + data:post.url' expr:title='data:top.shareToTwitterMsg' rel='nofollow' target='_blank'><i aria-hidden='true' class='fab fa-twitter'/></a> <!-- LINE --> <a class='sns-btn sns-btn-line' expr:href='"http://line.me/R/msg/text/?" + data:post.url' rel='nofollow' target='_blank' title='LINE で共有する'><i aria-hidden='true' class='fab fa-line'/></a> <!-- Facebook --> <a class='sns-btn sns-btn-facebook' expr:href='"https://www.facebook.com/sharer/sharer.php?u=" + data:post.url' expr:onclick='"window.open(this.href, \"_blank\", \"height=430,width=640\"); return false;"' expr:title='data:top.shareToFacebookMsg' rel='nofollow' target='_blank'><i aria-hidden='true' class='fab fa-facebook'/></a> <!-- Pocket --> <a class='sns-btn sns-btn-pocket' expr:href='"https://getpocket.com/edit?url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='blank' title='Pocket で共有する'><i aria-hidden='true' class='fab fa-get-pocket'/></a> <!-- B! Hatena --> <a class='sns-btn sns-btn-hatena' expr:href='"https://b.hatena.ne.jp/add?mode=confirm&url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank' title='Hatena で共有する'><i aria-hidden='true' class='fab fa-hatena' style='font-weight: bold;'>B!</i></a> </div> </div>