I'm trying to use Night Mode and override some core less variables (only some of them, not all).
I tried to do it this way, looking at how things are done in flarum/core:
.define-my-colors(@config-dark-mode);
.define-my-colors(false) {
@my-body-bg: red;
}
.define-my-colors(true) {
@my-body-bg: green;
}
@body-bg: @my-body-bg;
But apparently something is wrong and this doesn't work as expected: I get an error: variable @my-body-bg is undefined in file /opt/flarum/extensions/flarum-my-ext/resources/less/forum.less in forum.less on line 9
... Any idea why I cannot define variables like this ? Seems like in flarum/core this exact same way of defining variables works seamlessly !...