Fork me on Github

Shivam Verma
    Blog     Portfolio     About Me / Contact     Feed

An even fresher 'Fork me on GitHub' callout !

If you’re looking for a ‘Fork me on Github’ solution for your blog, I am sure you’ve come across the GitHub Corners or the Github Ribbons project.
So did I.

I had used a Github Ribbon for one of my earlier blogs and was looking for something new this time around and that’s when I came across Github Corners. An SVG based solution with an animated Octocat! Definitely cooler.

So I went ahead, added the relevant code to the layout but I missed having an explicit ‘Fork me on GitHub’ label with the svg. A little bit of googling about how to add a rotated text to SVG followed by some hacking and here’s the final result.

Fork me on Github!
Fork me on Github!

(Click on the code to select all)


What happens on smaller screens ?

  • If you are checking out this post on a smaller screen, you’re probably not seeing the text label at all and wondering what the fuss is all about. This code snippet supports this behaviour by default. For all screens where the width is less than 500px, the text is hidden automatically.
  • The height and width of the logo is also reduced to half of the original size on smaller screens.

But I need the text on smaller screns!

  • No worries. Just open the non-minified version of the code you’re using and remove the line .github-corner-text{display: none;} from the css. The text will be visible on smaller screens as well.

Can I change the text ?

  • The <svg> uses the <text> element to display the text. You simply need to replace ‘Fork me on Github’ in the snippet with your text.

How do I change the colours ?

  • Play around with the fill and color css properties of the <svg> element.

Project Repository

https://github.com/vshivam/github-corners-text

This project is a fork of the original Github Corners project. Thanks to Tim Holman for creating Github Corners!

comments powered by Disqus