Don't duplicate icons in the resulting CSS

Intead, use CSS variables.
This commit is contained in:
daudix
2024-08-26 21:43:56 +03:00
parent 2f00256c0f
commit 3121386fd3
12 changed files with 128 additions and 120 deletions

View File

@ -70,13 +70,13 @@ input[type="checkbox"] {
border-radius: calc(var(--rounded-corner-small) / 2);
&::before {
$icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M13.754 4.668c.176-.2.262-.461.246-.723a1 1 0 0 0-.34-.687 1 1 0 0 0-.726-.246 1 1 0 0 0-.688.34L5.95 10.547 3.707 8.3A1 1 0 0 0 2 9.01a1 1 0 0 0 .293.708l3 3c.195.195.465.3.742.293.278-.012.535-.133.719-.344zm0 0'/%3E%3C/svg%3E");
-webkit-mask-image: $icon;
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M13.754 4.668c.176-.2.262-.461.246-.723a1 1 0 0 0-.34-.687 1 1 0 0 0-.726-.246 1 1 0 0 0-.688.34L5.95 10.547 3.707 8.3A1 1 0 0 0 2 9.01a1 1 0 0 0 .293.708l3 3c.195.195.465.3.742.293.278-.012.535-.133.719-.344zm0 0'/%3E%3C/svg%3E");
-webkit-mask-image: var(--icon);
-webkit-mask-size: cover;
top: -0.125rem;
left: -0.125rem;
transform-origin: bottom left;
mask-image: $icon;
mask-image: var(--icon);
mask-size: cover;
width: 1rem;
height: 1rem;