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:
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-1-0 classes. You can also use ionic versions to filter styles, such as
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.
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.
In order to avoid breaking existing styles, version 4.1 will continue adding version classes both to
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.
Starting with this version, Windows Phone is no longer supported so you should remove all styles using Ionic classes ending with
-wp since they are no longer necessary.
Starting with this version, it is possible to use CSS variables to make easier customisations, so it's likely that you won't need to override as many styles as before.
You can see some examples in the sections below, and you can also look at the theme file to find some of the main variables of the app.
The main color in the app is Moodle Orange, but you can now change it by using the
--primary variable. This will probably reduce the CSS you are applying right now, but this only covers the main color.
For other colors, check out the colors section in the main documentation.
Border width and color (new)
On the header toolbar, we've added a bottom border that you can disable.
Text and buttons
Bottom tab bar (main menu)
Tab icon color
Selected tab icon color
Badge color and text
Individual tab background
Unselected tab styles
Selected tab styles
Items background color
Item divider background color
Empty divider background
The icons in the More page can now easily change their color:
To change a color on a particular icon, you'll have to use the class of each handler. For example, to change the color of the folder icon on the menu item named Files:
Item border color
The dividers background color can now be overridden using
You can now personalise some colors in the Login page, but keep in mind that this only includes the credentials page (the one after you select the site).
Message discussion page, including chat activity and comments:
You can also make some modifications on the input field:
This is a full example showcasing how to handle multiple versions:
As you can see we recommend to always add
body.ionic* to start the CSS selectors, you can also use
:root body.ionic5 or even