scramjet/src/client/css.ts
Toshit Chawda 4906b71e47
semicolons
2024-07-14 16:31:36 -07:00

26 lines
663 B
TypeScript

import { rewriteCss } from "./shared";
const cssProperties = [
"background",
"background-image",
"mask",
"mask-image",
"list-style",
"list-style-image",
"border-image",
"border-image-source",
"cursor",
];
// const jsProperties = ["background", "backgroundImage", "mask", "maskImage", "listStyle", "listStyleImage", "borderImage", "borderImageSource", "cursor"];
CSSStyleDeclaration.prototype.setProperty = new Proxy(
CSSStyleDeclaration.prototype.setProperty,
{
apply(target, thisArg, argArray) {
if (cssProperties.includes(argArray[0]))
argArray[1] = rewriteCss(argArray[1]);
return Reflect.apply(target, thisArg, argArray);
},
}
);