2023-11-27 12:52:14 +00:00
|
|
|
@mixin svgicon($icon, $color, $size: "16", $prefix: false, $has2x: false, $light-dark: false) {
|
2023-10-18 12:33:07 +00:00
|
|
|
background:
|
2023-10-23 13:17:12 +00:00
|
|
|
-make-icon-background($icon, $color, $size, $prefix, $has2x) no-repeat center/contain,
|
2023-10-18 12:33:07 +00:00
|
|
|
|
|
|
|
// Invisible backgrounds to preload all variants:
|
|
|
|
-make-icon-background($icon, 'white', $size, $prefix, $has2x) center/0,
|
|
|
|
-make-icon-background($icon, 'light', $size, $prefix, $has2x) center/0,
|
|
|
|
-make-icon-background($icon, 'dark', $size, $prefix, $has2x) center/0;
|
2023-11-27 12:52:14 +00:00
|
|
|
@if ($color == 'universal') {
|
|
|
|
@if ($light-dark) {
|
|
|
|
@include light-dark(fill, nth($light-dark, 1), nth($light-dark, 2));
|
|
|
|
}
|
|
|
|
@else {
|
|
|
|
fill: currentColor;
|
|
|
|
}
|
|
|
|
-moz-context-properties: fill, fill-opacity;
|
|
|
|
}
|
2023-10-18 12:33:07 +00:00
|
|
|
}
|
|
|
|
|
2023-11-27 12:52:14 +00:00
|
|
|
@mixin svgicon-menu($icon, $color, $size: "16", $prefix: false, $has2x: false, $light-dark: false) {
|
|
|
|
// Disable 2x because list-style-image doesn't support image-set
|
|
|
|
list-style-image: -make-icon-background($icon, $color, $size, $prefix, false);
|
|
|
|
@if ($color == 'universal') {
|
|
|
|
@if ($light-dark) {
|
|
|
|
@include light-dark(fill, nth($light-dark, 1), nth($light-dark, 2));
|
|
|
|
}
|
|
|
|
@else {
|
|
|
|
fill: currentColor;
|
|
|
|
}
|
|
|
|
-moz-context-properties: fill, fill-opacity;
|
|
|
|
}
|
2023-11-15 09:07:54 +00:00
|
|
|
}
|
|
|
|
|
2023-10-18 12:33:07 +00:00
|
|
|
@function -make-icon-background($icon, $color, $size, $prefix, $has2x) {
|
|
|
|
@if $has2x {
|
|
|
|
@if $prefix {
|
|
|
|
@return image-set(
|
|
|
|
url('chrome://zotero/skin/#{$prefix}/#{$size}/#{$color}/#{$icon}.svg') 1x,
|
|
|
|
url('chrome://zotero/skin/#{$prefix}/#{$size}/#{$color}/#{$icon}@2x.svg') 2x
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
|
|
|
@return image-set(
|
|
|
|
url('chrome://zotero/skin/#{$size}/#{$color}/#{$icon}.svg') 1x,
|
|
|
|
url('chrome://zotero/skin/#{$size}/#{$color}/#{$icon}@2x.svg') 2x
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
|
|
|
@if $prefix {
|
|
|
|
@return url('chrome://zotero/skin/#{$prefix}/#{$size}/#{$color}/#{$icon}.svg');
|
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
|
|
|
@return url('chrome://zotero/skin/#{$size}/#{$color}/#{$icon}.svg');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|