Design Social Media Sharing Buttons With Just CSS (And Nothing Else)

I am a big fan of minimalism. By minimalism, I don’t mean cutting down on features that are necessary. By minimalism, what I mean is keeping the bare minimum of bells and whistles so that the accessories don’t get in the way of the core of a product.

You might have noticed that this website has got a fresh coat of paint (thanks to @kaushik). In this re-design, I wanted to keep things simple and much focus was given on usability and loading time of the website. I have cut down a lot of things and tried to followed this principle

You have to make every single detail perfect. And you have to limit the number of details

This time, I decided to completely remove social sharing buttons that interfere with the loading time of the website. Facebook Like buttons, Twitter follow buttons, Twitter’s tweet buttons, Facebook recommendation widget, Google Plus follow buttons, the Plus one buttons – all of this had to be killed.

Here are some reasons why I decided to do this

Why I removed Social Sharing Buttons From this website

Facebook Like buttons takes a long time to load and its not a good user experience.

The tweet and Like buttons are not symmetric and they look a little ugly when placed side by side.

If the user is browsing this site on a slow connection, these buttons are the real culprits why the page hangs in the middle.

The content on this site does not get hundreds of “shares”, so the sharing buttons are not very useful from where we are standing now.

Regardless of the above reasons, I wanted to keep the sharing buttons on the following grounds

There will not be any JS / CSS calls by these buttons.

The social sharing buttons should use the minimum resources (e.g no separate images or CSS sprites).

The only way to integrate social sharing buttons without images, JS was to design it with CSS and load the sharing URL’s in a new browser tab.

If you want social media sharing buttons for your website that is designed with only CSS, here is the code you may want to use.

1. Paste this in your style.css file of before the ending head tag (</head> ) of the webpage

Note: It is recommended to copy the above code in a text editor and replace the double quotes manually before you implement the same in your website’s theme.

The above code does not use any image or JS or jQuery. You may note a tooltip style message is shown when you hover the mouse cursor over any of the icons. This tooltip is done with CSS only and there is absolutely no need of using any JavaScript at all.

Implementing social media sharing buttons using only CSS was very useful from the usability point of view. The next thing on my cards is to implement asynchoronous loading of different elements, I will be explaining the same in a future post (once I have successfully implemented it on this website).