%fieldset
	.container
		.svg
			%input#checkbox-svg{:type => "checkbox"}
			- 2.times do
				%div
			%svg{:viewBox => "0 0 24 24"}
				- 2.times do
					%g
						%line{:x1 => "4.5", :x2 => "9.24", :y1 => "12.5", :y2 => "17.24"}
						%line{:x1 => "9.24", :x2 => "19.76", :y1 => "17.24", :y2 => "6.73"}
		%label{:for => "checkbox-svg"} SVG
View Compiled
fieldset {
	.container {
		display: flex;
		align-items: center;
		align-content: center;
	}
	label {
		cursor: pointer;
		margin-left: $p/2;
	}
}

.svg {
	position: relative;
	overflow: hidden;
	border-radius: 2px;
	background: mix($slate, $grey, 20%);
	input {
		cursor: pointer;
		appearance: none;
		opacity: 0;
		position: absolute;
		z-index: 10;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		margin: 0;
	}
	div {
		opacity: 0;
		position: absolute;
		// first div, used for hover
		&:nth-of-type(1) {
			z-index: 0;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background: mix(mix($slate, $grey, 20%), $blue, 90%);
		}
		// second div, used for click
		&:nth-of-type(2) {
			transform-origin: center center;
			z-index: 1;
			top: calc(50% - 18px);
			left: calc(50% - 18px);
			border-radius: 100%;
			background: $blue;
			width: 36px;
			height: 36px;
		}
	}
	svg {
		position: relative;
		z-index: 2;
		display: block;
		width: 24px;
		height: 24px;
		line {
			stroke-width: 2px;
			stroke-linecap: round;
		}
		g {
			// default checkmark
			&:first-child {
				line {
					stroke: mix(white, $slate, 80%);
				}
			}
			// selected checkmark, hidden on default
			&:last-child {
				line {
					opacity: 0;
					stroke: white;
				}
			}
		}
	}
}

External CSS

  1. https://fonts.googleapis.com/css?family=Libre+Franklin:100,200,300,400,500,600
  2. https://codepen.io/tutsplus/pen/598c614630b8b6882828b40d33bdbf3a

External JavaScript

This Pen doesn't use any external JavaScript resources.