Skip to content
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

Merged
merged 2 commits into from
Jun 4, 2024
Merged

adding dynamic styling #1

merged 2 commits into from
Jun 4, 2024

Conversation

programminglaboratorys
Copy link
Contributor

making it so instead of hardcoding the classes names they get found on plugin start

@pernydev
Copy link
Owner

pernydev commented May 31, 2024 via email

style.ts Outdated
*/

export function getStyle(): [string, object] {
const t = findByProps("messageEditorCompact"); // ["messageContent","wrapper"]
Copy link
Contributor Author

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]);
Copy link
Contributor Author

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

Copy link
Owner

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.

@pernydev
Copy link
Owner

pernydev commented Jun 4, 2024

Looks good! I'll merge this here and update my PR version as well.

@pernydev pernydev merged commit 294e931 into pernydev:main Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants