Last active
October 18, 2016 04:48
-
-
Save itzikbenh/a0211bdaecd3b1c65dfb409fc850a905 to your computer and use it in GitHub Desktop.
Twitter share on text highlight. Inspired by theguardian.com. Tested on latest Chrome, Firefox, and Safari.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add this anywhere in the page. It assumes your content is inside an <article> tag. --> | |
<a class="floating-twitter-share-link" href="#" title="Share this" target="_blank"> | |
<i class="fa fa-twitter floating-twitter-share"></i> | |
</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.floating-twitter-share { | |
box-shadow: 0 1px 3px 0 rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 2px 1px -1px rgba(0,0,0,.12); | |
width: 40px; | |
height: 40px; | |
padding: 10px; | |
border-radius: 50%; | |
font-size: 20px; | |
color: $white; | |
background: #2EA3F2; | |
visibility: hidden; | |
position: fixed; | |
z-index: 9999999999; | |
text-align: center; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment