From b029ce47a00e8312b4ba97ac514454fee7dc6da4 Mon Sep 17 00:00:00 2001 From: Sqaaakoi Date: Mon, 20 Jan 2025 05:39:11 +1300 Subject: [PATCH] Utils/Margins: Switch to Styles API --- src/utils/margins.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils/margins.ts b/src/utils/margins.ts index 5d7eed766..66aa1f77a 100644 --- a/src/utils/margins.ts +++ b/src/utils/margins.ts @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +import { setStyle } from "@api/Styles"; + let styleStr = ""; export const Margins: Record<`${"top" | "bottom" | "left" | "right"}${8 | 16 | 20}`, string> = {} as any; @@ -29,7 +31,7 @@ for (const dir of ["top", "bottom", "left", "right"] as const) { } document.addEventListener("DOMContentLoaded", () => - document.head.append(Object.assign(document.createElement("style"), { - textContent: styleStr, - id: "vencord-margins" - })), { once: true }); + setStyle({ + name: "vencord-margins", + source: styleStr, + }), { once: true });