Documentation
Work in progress
Contributing
If you’d like to contribute in any way — be it writing documentation, submitting new userstyles, reporting and/or fixing bugs, suggesting ideas, letting userstyle creators know about this place, or really anything else — it will be very appreciated.
Adding a new userstyle
This is a short guide on how to convert your userstyle to UserCSS format, how to host it on GitHub (or somewhere else), and adding it to USw.
Setting up Stylus
The initial configuration and migration to UserCSS format.
- You need to go to Stylus Manage page by clicking on the Stylus icon on your toolbar, then on the Manage button. Once you’re there, you’ll have to enable checkbox next to “Write new style” that says “as UserCSS”
- With that set, you’re ready to click on “Write new style” and you’ll be presented with a default UserCSS template — do not delete anything, but you should replace default values to match your userstyle
- With that done, you’re ready to add your code. There are two ways:
- (Fast way) Go to your old userstyle, then press “Export” button below
“Mozilla Format” heading in the sidebar. Copy the code over to your new
userstyle and paste it at the very end. Remove the default
@-moz-document domain("example.com")
because it’s not necessary. - (Slow way) Go to your old userstyle, copy everything and put it inside of
@-moz-document
in your new userstyle. Make sure to change the defaultdomain("example.com")
to match your site — see “Applies to” area in your old userstyle for reference.
- (Fast way) Go to your old userstyle, then press “Export” button below
“Mozilla Format” heading in the sidebar. Copy the code over to your new
userstyle and paste it at the very end. Remove the default
- (Bonus) See Writing-UserCSS on Stylus' wiki for more information. There are lots of ways to customize the userstyle as well as lots of other options
Setting up a repository
This will be for GitHub, but the same principles apply to other git platforms, with one exception being that you’ll need to make a GitHub account to send the Pull Request, or send it to me via e-mail.
- Initialize a new repository
- Add a readme that includes some basic information and a screenshot
- Adding an install badge to readme would be great!
- Make a new file and copy your new userstyle over. Make sure to name it
something along the lines of
example.user.css
, with.user.css
being required otherwise Stylus won’t be able to recognize it as a UserCSS userstyle. - Commit it when you’re done
- Add a license to your project so that others can contribute
- Test in a separate profile/browser to confirm that your userstyle is working
Sending a Pull Request
The final step before your userstyle can be seen on USw. Have a look at the templates for other userstyles — Dark-WhatsApp is the best one — and view them as “raw” files to avoid pretty formatting on GitHub.
- Go to USw repository and click on “Fork” button in the top right corner
- Use a template to add information about your userstyle:
- Have a look at userstyles in
content/userstyle
directory for examples - Copy one of them over, or use
archetypes/userstyle.md
as base template - Fill in the fields
- Have a look at userstyles in
- Follow Creating a Pull Request article
- That should be it! I’ll review it and let you know if everything is alright
Working with Hugo
TODO Add how to contribute Hugo code.