5 Using Custom Themes
I am Fastidious edited this page 1 month ago

As of commit c29140a435 (28 October 2021), yarnd supports custom themes 🥳

Copy Default Theme

To use, you'll need to copy the default theme:

cp -a ./internal/theme ./my_theme

Minify CSS Assets

Then we'll need to minify the css assets, as yarnd in production/non-debug mode (i.e no -D flag) will expect the minified asset to exist! Important: You'll need to do this every time you make a change to the *.css files before running yarnd in production.

minify -b -o ./my_theme/static/css/yarn.min.css ./my_theme/static/css/[0-9]*-*.css

Note that you can use any CSS/JS minifier that you please. In the example above, we're using the standard minify program written in Go that's pulled in with the Git version of yarn but if using a binary or Docker release you may not have this. You may consider alternatives such as css-minify, minifier.org, YUI Compressor or whatever you like.

Use It!

Then finally, to use your custom theme, just run yarnd with the -t flag!

./yarnd -t ./my_theme

Now that your yarnd is using your own copy of the theme, modify it as you please.