Skip to content

Instantly share code, notes, and snippets.

@espadrine
Created January 2, 2014 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save espadrine/8218740 to your computer and use it in GitHub Desktop.
Save espadrine/8218740 to your computer and use it in GitHub Desktop.
Github badges. All svg images here are licensed CC0.
Display the source blob
Display the rendered blob
Raw
<svg xmlns='http://www.w3.org/2000/svg'>
<style type='text/css'>
text {fill:#fff; font-family:'Trebuchet MS',sans-serif; font-size:10px;}
</style>
<linearGradient id='ggreen' x2='0%' y2='100%'>
<stop offset='0' stop-color='#8f6'/>
<stop offset='0.1' stop-color='#5d2'/>
<stop offset='0.9' stop-color='#3b0'/>
<stop offset='1' stop-color='#370'/>
</linearGradient>
<linearGradient id='ggrey' x2='0%' y2='100%'>
<stop offset='0' stop-color='#aaa'/>
<stop offset='0.1' stop-color='#666'/>
<stop offset='0.9' stop-color='#444'/>
<stop offset='1' stop-color='#222'/>
</linearGradient>
<rect rx='4px' width='77px' height='18px' style='fill:url(#ggrey)'/>
<rect rx='4px' x='32px' width='45px' height='18px' style='fill:url(#ggreen)'/>
<rect x='32px' width='5px' height='18px' style='fill:url(#ggreen)'/>
<text x='5px' y='12.5px' style='stroke:rgba(0,0,0,0.3)'>build</text>
<text x='5px' y='12px'>build</text>
<text x='39px' y='12.5px' style='stroke:rgba(0,0,0,0.3)'>passed</text>
<text x='39px' y='12px'>passed</text>
</svg>
@mathiasbynens
Copy link

Ref. h5bp/lazyweb-requests#150

_Update:_ this gist has been updated and is now a fully-fledged repo: https://github.com/espadrine/gh-badges

@mathiasbynens
Copy link

Cleaned up version (removed some minor cruft):

<svg xmlns="http://www.w3.org/2000/svg">
  <style type="text/css">
    text {
      fill: #fff;
      font-family: Trebuchet MS, sans-serif;
      font-size: 10px;
    }
  </style>
  <linearGradient id="ggreen" x2="0%" y2="100%">
    <stop offset="0" stop-color="#8f6"/>
    <stop offset="0.1" stop-color="#5d2"/>
    <stop offset="0.9" stop-color="#3b0"/>
    <stop offset="1" stop-color="#370"/>
  </linearGradient>
  <linearGradient id="ggrey" x2="0%" y2="100%">
    <stop offset="0" stop-color="#aaa"/>
    <stop offset="0.1" stop-color="#666"/>
    <stop offset="0.9" stop-color="#444"/>
    <stop offset="1" stop-color="#222"/>
  </linearGradient>
  <rect rx="4" width="77" height="18" style="fill:url(#ggrey)"/>
  <rect rx="4" x="32" width="45" height="18" style="fill:url(#ggreen)"/>
  <rect x="32" width="5" height="18" style="fill:url(#ggreen)"/>
  <text x="5" y="12.5" style="stroke:rgba(0,0,0,.3)">build</text>
  <text x="5" y="12">build</text>
  <text x="39" y="12.5" style="stroke:rgba(0,0,0,.3)">passed</text>
  <text x="39" y="12">passed</text>
</svg>

It still validates as per http://validator.nu/ with the “SVG 1.1 + XHTML5 + MathML 3.0” setting.

@mathiasbynens
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment