Discourse Vincent theme

Somehow this had been working the same as always (with that css posted further up in the topic that fixed the borders) for me until I stupidly saw a new update today…

Now it says there’s an error

Error: @use rules must be written before any other rules. ╷ 4 │ @use "sass:math"; │ ^^^^^^^^^^^^^^^^ ╵ /var/www/discourse/common.scss 4:1 root stylesheet

And is COMPLETELY completely broken now lol.

If your install was previously still working like mine was it’s easy to fix. Download the theme from github, open common.css and change

// functions  --------------------------------------------------------------------------------

// Calculate brightness value
@use "sass:math";

@function brightness($color) {
  @return math.div(red($color) + green($color) + blue($color), 255 * 3);
}

// to base color

(This is the new change that broke it) to how it used to be below

// functions  --------------------------------------------------------------------------------

// Calculate brightness value
@function brightness($color) {
  @return (red($color) + green($color) + blue($color)) / (255 * 3);
}

// to base color

Which is what it had, then zip and upload to your site and use your own new installation. Or try to fix what he broke to see what he was trying to do.

Keep in mind this will upload it as an entirely new theme, and it’ll no longer be linked to the github if there’s future updates, so you might want to keep the original install (un-selectable) in case it gets fixed/support is picked back up. On the flip side installing it yourself allows to to fix or change what you want since it’s not actively managed anymore

3 Likes