Trouble creating grandchild theme

#1

I’m trying to create a child theme of the defaultManuscript theme (grandchild theme of the default theme) in OJS v3.1.2, but am facing an issue that is confounding me.

In the init() function of my BNZSEEManuscriptThemePlugin class, I have the following two lines:

$this->setParent(‘defaultmanuscriptchildthemeplugin’);
$this->modifyStyle(‘stylesheet’, array(‘addLess’ => array(‘styles/variables.less’)));

The contents of my styles/variables.less file is as follows (just for testing):

@bg: #222;

For some reason though, this results in me seeing the default theme with a dark background; not the defaultManuscript theme with a dark background as I’d expect.
If I comment out the line with the modifyStyle command though, I see the defaultMansucript theme unchanged.
Not quite sure what I’m doing wrong here. Any help would be much appreciated.

Thanks!

Reagan

#2

Hi @reagan,

If I understand the problem right, you cannot apply your styling modifications from a child of a Manuscript theme, right? I’ve made a testing just as you described and all works well in my case.

#3

Very strange indeed. I’ve placed my code creating a child of the defaultManuscript theme here: https://www.dropbox.com/sh/8a1nk2fjoeh66gr/AAA7ZS57tx9gNGwfZbl4M9EOa?dl=0

Upon loading this theme as is, I get the following results:

Upon commenting the $this->modifyStyle('stylesheet', array('addLess' => array('styles/variables.less'))); line in the BNZSEEManuscriptThemePlugin.inc.php file, I get the following results:

I’m finding it hard to understand why the inclusion of that one line produces the default theme with a dark background rather than the defaultManuscript theme with a dark background.

#4

Thanks. Yes, now I can reproduce it. This is relevant for grandchild themes - Manuscript theme is a child of the Default.
Filled it out as an issue: https://github.com/pkp/pkp-lib/issues/4704

#5

Great! Thanks a lot for your assistance troubleshooting this.