-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding dynamic styling #1
Conversation
style.ts
Outdated
*/ | ||
|
||
export function getStyle(): [string, object] { | ||
const t = findByProps("messageEditorCompact"); // ["messageContent","wrapper"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should maybe give better names for those
style.ts
Outdated
const Classes = Object.assign({}, o, l, u, v, t, f); | ||
let CssCode = CssFormatCode; | ||
for (const className in Classes) { | ||
CssCode = CssCode.replaceAll(`{${className}}`, Classes[className]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how I am able to use it if its giving an error in vscode Property 'replaceAll' does not exist on type 'string'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later.ts(2550)
could be of how vencord is compiled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a TS (guessing LSP) error I've had recently on other projects. The
code should be fine.
Looks good! I'll merge this here and update my PR version as well. |
making it so instead of hardcoding the classes names they get found on plugin start