Color palette not working for custom theme after upgrade

After upgrading to 3.4.0 our theme is no longer getting color definitions for the selected color palette. I see a CSS file that should have color definitions in it but it comes back empty when our theme is active.

So no colors get set and the background color for any popup window is transparent which makes the site unusable. We’re temporarily using the default Light theme instead as a workaround.

I’ve tried everything I can think of. For example:

  • Manually creating the color palette
  • Uninstalling and reinstalling the theme
  • Lots of trial and error on the live forum and a staging forum

Our theme is installed from a git repo. For a brief period we got the forum to look good by restoring an old development copy of the theme (not from a git repo) but then the next time we restarted Discourse it broke again.

On the staging forum when I uninstalled and reinstalled the theme that seems to have fixed it. But uninstalling and reinstalling on the live forum didn’t help.

When I switch to a default theme like Light or Dark, the color palette works fine, I can see all the colors defined in that CSS file.

What might cause the color definitions to come back empty for our theme? Any ideas on how to fix it?

This seems like a potential cause of the problem. Our theme has a setting that stores content for our about page. I don’t think we had an SCSS compile error before updating to Discourse 3.4.0. Maybe something changed in sass compilation and now it’s more strict?

But the problem seems to occur when Discourse starts up. If I just edit the content in that theme setting there is no SCSS error logged. If I restart Discourse, the SCSS error occurs that color definitions CSS file becomes blank again.

Here is the code in the theme that uses that setting, in a hbs file. The content in the setting is just HTML.

<div class="about-description-content">
	{{{theme-setting 'content_about_main'}}}
</div>
1 Like

I moved the HTML from a theme setting to directly in the hbs file and that seems to have solved the problem. I’m not sure why but Discourse 3.4.0 doesn’t like it in the theme setting.

1 Like

You probably need to add a helper here:

{{html-safe (theme-setting 'content_about_main')}}

That sounds likely. Is there documentation about that html-safe helper anywhere so that I can see what it does? I tried googling and can’t find it.

Here you go https://api.emberjs.com/ember/5.12/functions/@ember%2Ftemplate/htmlSafe

1 Like

Ahh thanks. I had been searching the handlebars documentation instead of ember.

1 Like