Mailspring: Custom themes can't be compiled from 1.0.8

Created on 10 Nov 2017  路  6Comments  路  Source: Foundry376/Mailspring

Since updating to 1.0.8, my custom themes fail to compile, as the base colour variables are missing (variable @gray is undefined). While this is a problem that could be fixed in my theme by setting those variables myself, this will also affect everyone using the nylas-mail-theme-starter, which is still the canonical basis for themes.

screen shot 2017-11-10 at 12 34 30

Because it causes a JS error, it also means I can't get far enough to be able to change the theme through the UI.

Most helpful comment

Hey! Sorry for the hassle鈥攄idn't realize there were custom themes floating around already!

To fix the theme, you probably just need to add this line to the top of the mailsprung/ui-variables.less file. We changed a few things and it no longer assumes you want to use the base variables file!

@import 'base/ui-variables';

All 6 comments

A quick work around to get it working on a different theme,
Load the config.json file
C:\Users\AppData\Roaming\Mailspring

and change
the Theme to something like this
"theme": "ui-light"

Hey! Sorry for the hassle鈥攄idn't realize there were custom themes floating around already!

To fix the theme, you probably just need to add this line to the top of the mailsprung/ui-variables.less file. We changed a few things and it no longer assumes you want to use the base variables file!

@import 'base/ui-variables';

Cool, that's fixed it. I definitely think it makes more sense for the import to be explicit, but I wasn't initially sure where those variables were coming from. :+1:

@bengotow I'm working on porting over the Material theme that was available for Nylas and ran into this issue. When I import the base/ui-variables, it fixes the aforementioned errors, but the colors are completely different than what I have specified. Are there more complexities that need to be addressed aside from what's stated here and in the migration guide?

Love the work you're doing on Mailspring, by the way. Looking forward to contributing to the project!

EDIT: Looks like the issues that I was facing were related to a bad cache. Clearing out the compile-cache from ~/Application Support/Mailspring seems to have fixed it.

Hey @opes - hmm interesting, thanks for letting me know it didn't work right off the bat. Basically what we're doing is 1) making it so that LESS files have to include ui-variables to reference / use them and 2) requiring that themes that want to modify ui-variables define their own version of the file that overrides values from the base theme (base/ui-variables).

Sorry it's kind of a messy migration... before, we were including all the base variables, followed by all your theme LESS, followed by the LESS we wanted to compile for every file, which was crazy slow and meant that sometimes weird things could happen because things were in your LESS scope you didn't explicitly ask for.

Let me know if you got Material working!

Hi everyone!
Ido is working on Mailspring 1.1.4 now 馃槃

Was this page helpful?
0 / 5 - 0 ratings