mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 23:50:02 -04:00
refactor: everything
This commit is contained in:
parent
78e666d314
commit
506d99f9b6
37 changed files with 925 additions and 885 deletions
24
src/client/dom/css.ts
Normal file
24
src/client/dom/css.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { ScramjetClient } from "../client";
|
||||
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"];
|
||||
|
||||
export default function (client: ScramjetClient) {
|
||||
client.Proxy("CSSStyleDeclaration.prototype.setProperty", {
|
||||
apply(ctx) {
|
||||
if (cssProperties.includes(ctx.args[0]))
|
||||
ctx.args[1] = rewriteCss(ctx.args[1]);
|
||||
},
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue