Skip to content

Instantly share code, notes, and snippets.

@LukyVj
Last active October 9, 2017 06:23
Show Gist options
  • Save LukyVj/55a39eaec27e35292db3 to your computer and use it in GitHub Desktop.
Save LukyVj/55a39eaec27e35292db3 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// SASSVG
//
// API :
// svg(<shape>, <size>, <color>, <unit>, <repeat>, <path:false>);
@mixin svg($shape, $size, $color, $unit, $repeat, $path: false) {
$svg:();
$vb_size: $size;
$svg-dec: 'width="#{$size*4}#{$unit}" height="#{$size*4}#{$unit}" viewBox="0 -#{$vb_size*2} #{$vb_size} #{$vb_size*4}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"';
@if $shape == circle {
$svg: '<svg #{$svg-dec}><circle cy="0" cx="0" r="#{$size}#{$unit}" fill="#{$color}"></circle></svg>';
}
@if $shape == square {
$svg: '<svg #{$svg-dec}><rect width="#{$size}#{$unit}" height="#{$size}#{$unit}" fill="#{$color}"></rect></svg>';
}
@if $shape == path {
$svg-dec: 'width="#{$size*4}#{$unit}" height="#{$size*4}#{$unit}" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"';
$svg: '<svg #{$svg-dec}><path d="#{$path}" stroke="#{$color}" fill="transparent"/></svg>';
}
background-image: url('data:image/svg+xml;utf8,#{$svg}');
background-repeat: $repeat;
}
html, body{
@include svg(path, 30, red, px, repeat, 'M96 664.097c0-139.904 78.016-251.84 156.032-363.776 156.032-223.872 52.032-363.776 157.44-271.552 180.544 159.616 76.544 467.392 206.528 467.392 104 0 93.76-182.272 93.76-182.272 0.896-34.944 23.936-44.992 49.664-21.824 0 0 168.576 120.128 168.576 316.032 0 188.544-108.288 349.888-261.568 415.872 1.024-7.872 1.6-15.936 1.6-24.128 0-92.736-69.824-167.872-156.032-167.872-86.144 0-156.032 75.2-156.032 167.872 0 8.192 0.576 16.256 1.6 24.128-153.28-65.984-261.568-136.064-261.568-359.936v0.064zM615.616 44.513c34.752-4.288 101.888 16.256 141.376 82.496 55.104 95.552-99.584 140.16-118.592 37.312s-57.536-115.52-22.784-119.744v-0.064z');
width: 100%;
height: 100%;
}
html, body {
background-image: url('data:image/svg+xml;utf8,<svg width="120px" height="120px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M96 664.097c0-139.904 78.016-251.84 156.032-363.776 156.032-223.872 52.032-363.776 157.44-271.552 180.544 159.616 76.544 467.392 206.528 467.392 104 0 93.76-182.272 93.76-182.272 0.896-34.944 23.936-44.992 49.664-21.824 0 0 168.576 120.128 168.576 316.032 0 188.544-108.288 349.888-261.568 415.872 1.024-7.872 1.6-15.936 1.6-24.128 0-92.736-69.824-167.872-156.032-167.872-86.144 0-156.032 75.2-156.032 167.872 0 8.192 0.576 16.256 1.6 24.128-153.28-65.984-261.568-136.064-261.568-359.936v0.064zM615.616 44.513c34.752-4.288 101.888 16.256 141.376 82.496 55.104 95.552-99.584 140.16-118.592 37.312s-57.536-115.52-22.784-119.744v-0.064z" stroke="red" fill="transparent"/></svg>');
background-repeat: repeat;
width: 100%;
height: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment