Search code examples
twitter-bootstrapbootstrap-4dspace

How do you change the Mirage 2 bootstrap theme on DSpace 6.2?


I am trying to replace the default Mirage 2 theme on my DSpace repository with one of those from bootswatch.com . I started by editing my _main.scss file

[dspace-source]\dspace\modules\xmlui-mirage2\src\main\webapp\themes\Mirage2\styles\styles\bootstrap_color_scheme\

to import the new theme as follows:

@import "../vendor/bootstrap-sass-official/assets/stylesheets/bootstrap/_variables";
@import "bootswatch.min.css";

Then I found (or think i found) the locations to copy both the bootstrap.min.css and the variables.scss files in the source. I have the copied bootstrap.min.css file to:

[dspace-source]\dspace\modules\xmlui-mirage2\src\main\webapp\themes\Mirage2\styles\styles\

And the _variables.scss file to:

[dspace-source]\dspace\modules\xmlui-mirage2\target\xmlui-mirage2-6.2\themes\Mirage2\vendor\bootstrap-sass-official\assets\stylesheets\bootstrap\

I get no errors while building but the older theme is still persistent. Note: I restart my servlet and clear both the Tomcat and browser cache before deploying the webapp. What could be the problem?


Solution

  • Maybe you did not activate the mirage2_bootstrap_color_scheme maven profile? Try adding -P mirage2_bootstrap_color_scheme when rebuilding ie mvn package -Dmirage2.on=true -Dmirage2.deps.included=false -P mirage2_bootstrap_color_scheme.

    Mirage 2 contains two color schemes to choose from. The classic Mirage color scheme or the standard Bootstrap color scheme. By default, Grunt will build CSS to get the classic Mirage color scheme. However, by activating the mirage2_bootstrap_color_scheme maven profile, this can be changed to get the standard Bootstrap color scheme.

    Also, maybe these post can help you: Styling of Mirage 2 using themes from bootswatch.com