DEV Community

Discussion on: Replacing Twitter Share / Follow Widget Buttons with CSS

Collapse
 
gamesover profile image
James Moberg

If you want access to more social media services & CSS styles, here's a generator that can save up to 26 HTTP requests (based on if you used all of the services.)
sharingbuttons.io/

We started using CSS to emulate the look-and-feel of social media, search & pay widgets in the early 2000's as a way to improve both webperf and privacy.

CSP-wise, we approached this feature by creating a CFML CFC to perform post-page transformations to parse the output buffer using jsoup only if it hadn't flushed yet. It automatically output valid HTML, optimizes the head/body sections (defer, relocate JS to head/footer, modernize for HTML, etc), adds unique a11y hints & attributes where needed and identifies whitelisted social media hosts to automatically inject inline nonces & CSP headers into the HTTP response. (We also set up our own Taffy endpoint for collecting CSP errors.)