Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Moodle App Remote Themes

From MoodleDocs

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.


Please, note that due a framework update (Ionic 1 to Ionic 3), Moodle app version 3.5 onwards is not compatible with the existing custom themes / styles.

However, you can keep your current style sheet so they will work with the Moodle Classic app or old Moodle Mobile versions.

In order to do that, you just need to add this line at the end of your existing theme:

/* 3.5 styles */

And add below this line your 3.5 onwards styles.

See the following file for an example of a theme with styles for the old and new versions of the app:

https://gist.githubusercontent.com/jleyva/5d2f265a833a2122f3be/raw/ea0443a0111792231766dc6d78f9038928a3813e/moodlemobileapp.css

In order to create your own theme for the Moodle app 3.5.0 onwards, we recommend to use the webapp: https://mobileapp.moodledemo.net/ (requires Chrome or Chromium browser) and use the inspection tool to check the classes you need to change.

How remote themes work

  1. When you enter a site in the app it checks if there's any file configured on mobilecssurl administration field on the site.
  2. The app downloads and load the file.
    1. If the separator /* 3.5 styles */ is found it will load the css before or after depending on the version of the app you are running.
    2. If the separator is not found, it will load the whole css.
  3. CSS selectors that contains the platform name (ios, md or wp) will only be used depending on the platform. If you want to apply it to every platform, add the three selectors.
    1. ios is for all apple platforms: including iPhone, iPad and macOS desktop app.
    2. md is for all material design platform: including Android phones and tablets, Chrome OS and Linux desktop app.
    3. wp is for all windows platforms: including Windows phone and Windows Store app.
    4. Example:

.toolbar-background-ios, .toolbar-background-md, .toolbar-background-wp {

 background: #5069A1;

}