Moodle App Remote Themes Upgrade Guide
In the following guide, you will learn how to migrate your styles from an older version of the app.
However, keep in mind that not all your users will be using the latest version. We recommend that you keep your old CSS rules for older versions as indicated in the Before starting the migration section. By doing so, users who haven't updated the app will continue seeing the same styles they had until now.
Depending on which version of the app you're upgrading from, you'll need to go through multiple version upgrades. This guide is divided by version ranges, so you should be able to start with your current version and build up from there.
Before starting the migration
We recommend prepending all conflicting CSS rules with the specific version they are targeting.
For example, for a CSS stylesheet that targets both 4.0 and 4.1 versions, you should do the following:
html.moodleapp-4-1 {
--ion-color-primary: red;
}
body.moodle-app-4-0 {
--ion-color-primary: green;
}
You can use these classes to target specific major and patch versions as well, so for example version 4.1.0 ships with moodleapp-4
, moodleapp-4-1
, and moodleapp-4-1-0
classes. You can also use ionic versions to filter styles, such as ionic3
or ionic5
.
Notice that mode and version classes moved from the body
tag to the html
tag in version 4.1. Learn more about this when upgrading from 4.0 to 4.1.
How to upgrade my theme
You can follow the same process that is documented in the Moodle App Remote Themes page.
Make sure to read it in order to understand how to style your application for newer versions of the app. If you're upgrading your styles, it is likely that the documentation has been updated since you read it. So we recommend taking a look even if you're already familiar with Remote Themes.
4.1 to 4.2
The only change to keep in mind for this release is that Font Awesome icons were upgraded to version 6.3.0. This shouldn't affect Remote Themes directly, but given that it affects the visuals aspects of the app, it could potentially be relevant.
4.0 to 4.1
There is only one thing to look after when upgrading to 4.1, so it should be a relatively quick process.
Mode classes
Starting in 4.1, mode and version classes have been moved from the body
tag to the html
tag. This change arose from a bug on derived CSS variables, and it should be fairly straightforward to make.
body {
--core-header-toolbar-background: red;
}
body.dark {
--core-header-toolbar-background: green;
}
html {
--core-header-toolbar-background: red;
}
html.dark {
--core-header-toolbar-background: green;
}
In order to avoid breaking existing styles, version 4.1 will continue adding version classes both to body
and html
tags. But using the classes from the body
tag is considered a deprecated approach, and won't be supported in future versions. So we recommend that you update your Remote Themes now.
3.9.5 to 4.0
There haven't been any breaking changes from 3.9.5 to 4.0 in terms of theming functionality, but the UI of the application has changed drastically so we recommend going over all the customisations to see that they are still relevant in the new version.
3.9.4 to 3.9.5
This upgrade requires more changes than usual because the Moodle App was upgraded the underlying Ionic framework from version 3 to version 5, which introduced many breaking changes.