Creating a theme module and brand logo with Mendix 11

0
Hi,   I created a theme module with Mendix 10.24 following this documentation and it was working great. In my theme module custom-variable.scss file I changed the following variables to display our logo and I placed the logo within the folder <App directory>\themesource\my_custom_theme\public\images  :    It was working as intended and I could find my logo within the page sources :        I tried updating my app to Mendix 11.3 but now the logo cannot be display. The documentation still states that you can put your images and other re-usables resources in a themesource\{MODULE_NAME}\public folder but not I cannot find my logo in the sources of my page.  The custom-variables.scss has changed in Mendix 11 but you can still find the variable $brand-logo at the very top  :      Can anyone help me understand what I'm missing or doing wrong please ?
asked
2 answers
0

The problem comes from {App directory}\themesource\atlas_core\web\layouts\_layout-atlas.scss .

Lines 103 and 104 have errors : 

padding: calc(var(--brand-logo-height / 2)) calc(var(--brand-logo-width / 2));
background-image: url(var($brand-logo));

It should be :

padding: calc(var(--brand-logo-height) / 2) calc(var(--brand-logo-width) / 2);
background-image: url(#{$brand-logo});

 

After changing that, my logo was correctly displayed with this in custom-variables.scss : 

image.png

answered
-1

 Fix

Move your logo to

themesource/<your_theme>/web/images/

and set

$brand-logo: "./images/logo.png";

 Why

  • The old public folder is no longer copied at build time.

  • Only files in /web or explicitly imported in SCSS are bundled.

 Alternative

If you want to keep it in public/images, import it manually:

@import "./public/images/logo.png"; $brand-logo: url("./public/images/logo.png");

answered