sharect.js is a lightweight, zero-dependency JS library that converts any selected text into shareable quotes, which are allowed to share on Twitter and/or Facebook, as you seen in Medium.com.
Install the Sharect via NPM:
Import the minified version of the sharect library into your html document.
Initialize the sharect to make all your text within the document shareable.
Enable / disable Twitter & Facebook shareing:
Set the background & icon colors: