Skip to content

Instantly share code, notes, and snippets.

@ViliamKopecky
Created April 4, 2016 08:15
Show Gist options
  • Save ViliamKopecky/f129d568a406ac24eca90b82761b700b to your computer and use it in GitHub Desktop.
Save ViliamKopecky/f129d568a406ac24eca90b82761b700b to your computer and use it in GitHub Desktop.

SVG

<!-- definice SVG spritu -->
<svg class="shape-defs" width="0" height="0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <symbol id="shape-star" viewBox="0 0 23 21">
    <path  d="M11.5 16.34l-5.43 2.85 1.04-6.04-4.39-4.28 
    6.07-.88 2.71-5.49 2.71 5.49 6.07.88-4.39 4.28 1.04 6.04-5.43-2.85zm0 0"/>
  </symbol>
  <symbol id="shape-close" viewBox="0 0 20 20">
		<path d="M 1.87 1.87 L 18.19 18.19" />
		<path d="M 18.46 1.67 L 2.13 18" />
  </symbol>
</svg>

<!-- Použití -->
<svg class="shape shape-star">
  <use xlink:href="#shape-star">
</svg>
.shape {
	display: inline-block; vertical-align: middle; line-height: inherit;
	&-defs {
		visibility: hidden; position: absolute; width: 0; height: 0; overflow: hidden;
	}
	// Shapes default dimensions
	&-star { width: 23px; height: 21px; fill: #eee;	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment