The new code from tumblr {LikeButton}
comes with a very few options: color and size.
It injects an iFrame, which handles the "Like" functionality and provides SVG graphics.
However because of the iframe and cross site scripting policies, it is no longer possible to alter it with css nor to edit its contents.
How can I modify, or insert new code, to use my own Like button sprites or svgs?
Here's the best possible solution as of right now, with credit to @mikedidthis's post!
Put the like button in a parent,
div
,li
or whatever and call it something like.like
. Above the button put the SVG used by Tumblr for the heart icon:Change
<svg width="..." height="..."...
and{LikeButton size="..."}
to your desired size.Now just use a bunch of simple CSS
While on it here's how to do the same for the reblog button - since it's not called in an iFrame things are a bit more simple. Put it in a parent
div
,li
or whatever and call it something like.reblog
And the CSS
Originally posted here.
Styling a Tumblr Like Button
Sadly, as the OP has stated the Tumblr like buttons have minimal visual options and are hard to target with CSS / javascript. So time for a new idea...
The Idea
We know two things:
Our own Like Button, should visually, be whatever we desire. Text, image, webfont, etc.
The Tumblr Like Button registers a click, and Tumblr does its magic in storing the data.
If we can visually hide the Tumblr Like Button and then place it over our own Like Button, we have a styled, working Like Button!
Theme Markup
Example of the theme markup, the key here is to have a containing element for both Like Buttons, and to make sure the Tumblr Like Button comes before our own Like Button so we can take advantage of the adjacent sibling selector in the css.
Rendered Markup
Example of the rendered / live code. The Theme Operator
{LikeButton}
is now a<div>
with the class.like_toggle
.CSS Magic
The key again is to get the Tumblr Like Button above our Own Like Button.
Tada! You should now have your own Like Button that registers a users like!
You can also style it when hovered:
And when a user has registered a like:
I hope that helps! If you get stuck I left the markup here.
i did easy color choose like reblog button
exmpl: http://dennsokagisanat.tumblr.com/
http://reduxsarmadeneme.tumblr.com/
1. add meta tags over this code:
2. and add html code:
and 3. add css styles codes
thats it :)