Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

6. Using CSS inside your plugins

12944qwerty edited this page Sep 6, 2022 · 2 revisions

Using CSS

Replugged makes custom CSS for your plugins really easy via the this.loadStylesheet() function, it allows you to Load a CSS file on plugin load!

Imagine we have something like this as a file structure, we can add a file called style.css at the root of the plugin folder

🗀 example-plugin
 |_ manifest.json
 |_ index.js
 |_ style.css

The style.css's file has no set structure, meaning you can just paste random stuff into it like this

( Note, please do not paste exactly this into it, the snippets below are just examples )

* {
    display: none;
}

#id .img {
    width: 60px;
}

You get the point.

Making Replugged load the file

Making replugged load your CSS file is really easy, all you have to do is add one line into your index.js.

[...]
  startPlugin() {
    this.loadStylesheet('./style.css'); // replace style.css with the path/name of your css file
  }
[...]

And you're done! You don't even need to worry about unloading the stylesheet, replugged does that for you!