Skip to content

Instantly share code, notes, and snippets.

@PonteIneptique
Created February 21, 2022 09:54
Show Gist options
  • Save PonteIneptique/7813bb99f234b334fbf9c6c429ec2406 to your computer and use it in GitHub Desktop.
Save PonteIneptique/7813bb99f234b334fbf9c6c429ec2406 to your computer and use it in GitHub Desktop.
HTR-United Badge Template
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="{{ badge width }}" height="20" role="img" aria-label="{{ label }}: {{ value }}">
<title>{{ label }}: {{ value }}</title>
<mask id="{{ mask id }}">
<rect width="{{ badge width }}" height="20" fill="#fff"/>
</mask>
<g mask="url(#{{ mask id }})">
<path fill="#333" d="M0 0h{{ color split x }}v20H0z"/>
<path fill="{{ color }}" d="M{{ color split x }} 0h{{ value width }}v20H{{ color split x }}z"/>
</g>
<g fill="{{ label text color }}" text-anchor="middle" font-family="{{ font name }}" font-size="{{ font size }}">
<text x="{{ label anchor }}" y="14">{{ label }}</text>
</g>
<g fill="{{ value text color }}" text-anchor="middle" font-family="{{ font name }}" font-size="{{ font size }}">
<text x="{{ value anchor }}" y="14">{{ value }}</text>
</g>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment