snipe/web/node_modules/@iconify/utils/lib/css/icon.js
pyr0ball 7a704441a6 feat(snipe): Vue 3 frontend scaffold + Docker web service
- web/: Vue 3 + Vite + UnoCSS + Pinia, dark tactical theme (amber/#0d1117)
- AppNav, ListingCard, SearchView with filters/sort, composables
  (useSnipeMode, useKonamiCode, useMotion), Pinia search store
- Steal shimmer, auction countdown, Snipe Mode easter egg all native in Vue
- docker/web/: nginx + multi-stage Dockerfile (node build → nginx serve)
- compose.yml: api (8510) + web (8509) services
- Dockerfile CMD updated to uvicorn for upcoming FastAPI layer
- Clean build: 0 TS errors, 380 modules
2026-03-25 15:11:35 -07:00

52 lines
No EOL
1.4 KiB
JavaScript

import { defaultIconProps } from "../icon/defaults.js";
import { generateItemCSSRules, generateItemContent, getCommonCSSRules } from "./common.js";
import { formatCSS } from "./format.js";
/**
* Get CSS for icon, rendered as background or mask
*/
function getIconCSS(icon, options = {}) {
const body = options.customise ? options.customise(icon.body) : icon.body;
const mode = options.mode || (options.color || !body.includes("currentColor") ? "background" : "mask");
let varName = options.varName;
if (varName === void 0 && mode === "mask") varName = "svg";
const newOptions = {
...options,
mode,
varName
};
if (mode === "background") delete newOptions.varName;
const rules = {
...options.rules,
...getCommonCSSRules(newOptions),
...generateItemCSSRules({
...defaultIconProps,
...icon,
body
}, newOptions)
};
return formatCSS([{
selector: options.iconSelector || ".icon",
rules
}], newOptions.format);
}
/**
* Get CSS for icon, rendered as content
*/
function getIconContentCSS(icon, options) {
const body = options.customise ? options.customise(icon.body) : icon.body;
const content = generateItemContent({
...defaultIconProps,
...icon,
body
}, options);
return formatCSS([{
selector: options.iconSelector || ".icon::after",
rules: {
...options.rules,
content
}
}], options.format);
}
export { getIconCSS, getIconContentCSS };