url-encoder icon indicating copy to clipboard operation
url-encoder copied to clipboard

there is a much better way to handle this without having to rely on fixed height/width

Open dagadbm opened this issue 4 years ago • 1 comments

Just add a before pseudo element to the div you want to add the image and do content: url(mySvg);

dagadbm avatar Jul 22 '20 10:07 dagadbm

example

	.warn-icon {
		&::before {
			content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath fill='%23FFA000' d='M10 0c5.514 0 10 4.486 10 10s-4.486 10-10 10S0 15.514 0 10 4.486 0 10 0zm0 1.25c-4.825 0-8.75 3.925-8.75 8.75s3.925 8.75 8.75 8.75 8.75-3.925 8.75-8.75S14.825 1.25 10 1.25zm0 11.875A.938.938 0 1110 15a.938.938 0 010-1.875zm0-9.375c.345 0 .625.28.625.625v6.875a.625.625 0 01-1.25 0V4.375c0-.345.28-.625.625-.625z'/%3E%3C/svg%3E");
		}
	}

dagadbm avatar Jul 22 '20 10:07 dagadbm