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

feat: usercss #1700

Open
wants to merge 93 commits into
base: dev
Choose a base branch
from
Open

feat: usercss #1700

wants to merge 93 commits into from

Conversation

lewisakura
Copy link
Collaborator

@lewisakura lewisakura commented Sep 2, 2023

Full UserCSS support for Vencord, featuring a settings dialogue, compilers for stylesheets (LESS and Stylus supported), and hot-reload (both for variable changes and when the stylesheet code is updated).

Parses UserCSS/UserStyle files (.user.css) but doesn't do anything
special yet with the variables. This is a first step towards
supporting UserCSS themes.
@lewisakura lewisakura marked this pull request as draft September 2, 2023 16:59
@lewisakura
Copy link
Collaborator Author

TODO:

  • settings UI
  • storing usercss settings somewhere

WONTFIX:

  • conflicting variable names (this will usually result from using two large themes at once which is a very silly idea, and snippets should really be using unique variable names unless they're doing the same thing)

@lewisakura
Copy link
Collaborator Author

I have written some tests that demo all of the compilers and some error resiliency in case you want to try it out. If your text goes red, it did the thing.

src/main/ipcMain.ts Outdated Show resolved Hide resolved
src/main/ipcMain.ts Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@lewisakura lewisakura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm so tired

@lewisakura
Copy link
Collaborator Author

As far as I'm concerned, the actual feature implementation is now complete, so it's just refactoring and cleanup. I'll open it for review for suggestions on the aforementioned.

@lewisakura lewisakura marked this pull request as ready for review September 9, 2023 09:57
@lewisakura
Copy link
Collaborator Author

conflicting variable names (this will usually result from using two large themes at once which is a very silly idea, and snippets should really be using unique variable names unless they're doing the same thing)

This is not really the case and I sort of "fixed" it by isolating UserCSS variable configuration into their own settings subsets. In the case of vanilla CSS though (where it's injected using a :root selector) this can still cause conflicts, but in other compiled themes (i.e., Less, Stylus, and USO) it will work without conflict.

@wolfieboy09
Copy link

This has not been merged yet @coolesding

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.

9 participants