<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Basbrands</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Basbrands"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Basbrands"/>
	<updated>2026-04-10T18:42:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61525</id>
		<title>Moodle 4.0 developer update</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61525"/>
		<updated>2021-11-18T08:50:26Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Introduction of a new activity icons */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 4.0}}This page highlights the important changes that are coming in Moodle 4.0 for developers. Including how the UX improvements impact custom themes, relevant API changes, and what you can do as developer to prepare for the 4.0 release.&lt;br /&gt;
== Theme changes ==&lt;br /&gt;
The 4.0 theme changes can be classified as changes to improve overall navigation, changes for the course navigation and page, and general UI improvements for Moodle 4.0 and newer only.&lt;br /&gt;
==== Navigation UI changes ====&lt;br /&gt;
A new layout has been added that pushes the blocks region offscreen called the drawers layout. This layout has a fixed width of 800px for the main content area and page buttons to open / close the drawers. Files:&lt;br /&gt;
 /theme/boost/layouts/drawers.php&lt;br /&gt;
 /theme/boost/templates/drawers.mustache&lt;br /&gt;
In case a page uses “fake blocks” (for example book, quiz, calendar, etc.) the drawer region will be opened automatically on first visit.&lt;br /&gt;
&lt;br /&gt;
Child themes implementing this layout should update the theme config.php and configure the ‘drawers’ layout from theme boost for pages like ‘course’ and ‘incourse’&lt;br /&gt;
&lt;br /&gt;
Pages that should not use the drawers layout are the admin pages or other pages that require more horizontal space in the main content area.&lt;br /&gt;
===== Primary / secondary navigation =====&lt;br /&gt;
The top navbar now includes the new &#039;&#039;&#039;primary navigation&#039;&#039;&#039;, this navigation used to be in the page navdrawer region. If custommenu items are configured in the global theme settings they will be added to the primary navigation.&lt;br /&gt;
&lt;br /&gt;
The main content area shows tabs for secondary navigation with a maximum of 5 items being rendered in this ‘more’ menu. A new UI component has been created to render menus like this. Files:&lt;br /&gt;
 /lib/templates/moremenu.mustache&lt;br /&gt;
===== Navigation upcoming changes =====&lt;br /&gt;
===== Edit switch. =====&lt;br /&gt;
MDL-71610&lt;br /&gt;
&lt;br /&gt;
On theme boost the “Turn editing on” and  “Customise this page” buttons have been replaced by an edit switch in the top navbar. Theme Classic will keep using the old buttons. Child themes can choose to use the edit switch if the theme config.php is using this variable&lt;br /&gt;
 $THEME-&amp;gt;haseditswitch = true;&lt;br /&gt;
The languague menu, which used to be rendered in place of the custom menu has moved to the user dropdown when the user is logged in. If not logged in it will be placed next to the search / notification / messaging icon in the top navbar.&lt;br /&gt;
==== Course navigation and the course page ====&lt;br /&gt;
===== Introduction of a new course index component =====&lt;br /&gt;
The new course index feature can be themed using a set of scss variables. Use them to change the look and feel instead of adding custom css&lt;br /&gt;
 /theme/boost/scss/moodle/courseindex.scss&lt;br /&gt;
With the introduction of the course index component, the previous and next links shown underneath each activity are no longer needed and they will be removed.&lt;br /&gt;
===== Introduction of a new activity icons =====&lt;br /&gt;
The icons used for activities have been redesigned and updated for all core moodle activities.&lt;br /&gt;
&lt;br /&gt;
When viewing the new icons in a file manager, for example for the quiz activity, you will see a simple black monochrome icon with a transparent background.&lt;br /&gt;
&lt;br /&gt;
On the course page, or in the activity chooser, the icon will display as a white icon on a coloured background. Styling of the icons on the coursepage is controlled by the css in theme/boost/scss/moodle/icons.scss.&lt;br /&gt;
&lt;br /&gt;
The background colour for activity icons is set using a new variable in function [modname]_supports(). The quiz activity is of type assessment, so in function quiz_supports() there is a new line defining the purpose:&lt;br /&gt;
 case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_ASSESSMENT;&lt;br /&gt;
Available purposes are:&lt;br /&gt;
* MOD_PURPOSE_COMMUNICATION&lt;br /&gt;
* MOD_PURPOSE_ASSESSMENT&lt;br /&gt;
* MOD_PURPOSE_COLLABORATION&lt;br /&gt;
* MOD_PURPOSE_CONTENT&lt;br /&gt;
* MOD_PURPOSE_ADMINISTRATION&lt;br /&gt;
* MOD_PURPOSE_INTERFACE&lt;br /&gt;
The background colours linked to these purposes are set in theme/boost/scss/moodle/variables.scss&lt;br /&gt;
 $activity-icon-colors: map-merge(&lt;br /&gt;
     (&lt;br /&gt;
         &amp;quot;administration&amp;quot;: #5d63f6,&lt;br /&gt;
         &amp;quot;assessment&amp;quot;: #eb66a2,&lt;br /&gt;
         &amp;quot;collaboration&amp;quot;: #f7634d,&lt;br /&gt;
         &amp;quot;communication&amp;quot;: #11a676,&lt;br /&gt;
         &amp;quot;content&amp;quot;: #399be2,&lt;br /&gt;
         &amp;quot;interface&amp;quot;: #a378ff&lt;br /&gt;
     ),&lt;br /&gt;
     $activity-icon-colors&lt;br /&gt;
 );&lt;br /&gt;
If activity plugins do not define FEATURE_MOD_PURPOSE the activity icon will be rendered against a light grey background. There is no requirement to define the purpose of activity plugins, it will only affect the icon styling.&lt;br /&gt;
&lt;br /&gt;
Plugins implementing the variable FEATURE_MOD_PURPOSE are only supported on Moodle 4.0 and newer.&lt;br /&gt;
&lt;br /&gt;
Customising the activity icon can be done in an alternative way. For example using the styles.css in mod/[pluginname/styles.css&lt;br /&gt;
&lt;br /&gt;
In the example below the activity plugin developer chooses to keep the coloured icon for the activity and render it as large as the coloured background on the core activities&lt;br /&gt;
 .modicon_subcourse.activityiconcontainer {&lt;br /&gt;
     background-color: transparent;&lt;br /&gt;
     padding: 0;&lt;br /&gt;
 }&lt;br /&gt;
  &lt;br /&gt;
 .modicon_subcourse.activityiconcontainer img {&lt;br /&gt;
     width: 50px;&lt;br /&gt;
     height: 50px;&lt;br /&gt;
 }&lt;br /&gt;
To customize all icon colours use this scss array and add it to the ‘Raw initial SCSS’ in the theme Boost advanced settings page. The complete array of icon background colours can be overridden using the ‘Raw initial SCSS’ in the theme settings page. The example below changes the colours of each activity type.&lt;br /&gt;
 $activity-icon-colors: (&lt;br /&gt;
     &amp;quot;administration&amp;quot;: #5D63F6,&lt;br /&gt;
     &amp;quot;assessment&amp;quot;: #11A676,&lt;br /&gt;
     &amp;quot;collaboration&amp;quot;: #EB66A2,&lt;br /&gt;
     &amp;quot;communication&amp;quot;: #F7634D,&lt;br /&gt;
     &amp;quot;content&amp;quot;: #399BE2,&lt;br /&gt;
     &amp;quot;interface&amp;quot;: #A378FF&lt;br /&gt;
 )&lt;br /&gt;
===== General UI improvements upcoming changes =====&lt;br /&gt;
===== Login page =====&lt;br /&gt;
MDL-69371&lt;br /&gt;
&lt;br /&gt;
The login page has been redesigned and allows the admin to configure a background image for the login page only in the theme settings page. This change is available in both Boost and Classic. The login page still has all the features with an improved layout. &lt;br /&gt;
===== The page footer =====&lt;br /&gt;
MDL-71965&lt;br /&gt;
&lt;br /&gt;
In large screens, the page footer button is only visible when clicking a help button at the bottom right of the screen.&lt;br /&gt;
===== User initials as profile picture placeholder =====&lt;br /&gt;
MDL-72305&lt;br /&gt;
&lt;br /&gt;
If users do not upload a profile picture the user initials are displayed on a rounded gray background as a placeholder picture in the top navbar or any other page using a placeholder image. This change will be available in both Boost and Classic. &lt;br /&gt;
&lt;br /&gt;
With the introduction of this placeholder image the full username will no longer be displayed in the top navbar.&lt;br /&gt;
===== Removal of back to top link =====&lt;br /&gt;
MDL-72454&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;back to top&amp;quot; link will be removed for theme boost since the new course index reduced the dependence on page scrolling. Also, the new footer is positioned where this component used to be.&lt;br /&gt;
===== Styling changes =====&lt;br /&gt;
By default rounded edges will be used for UI components MDL-72455, for the page header and main content area the borders will be removed MDL-72457. &lt;br /&gt;
== Component library ==&lt;br /&gt;
==== Purpose of the Component Library ====&lt;br /&gt;
Each Moodle installation now ships with a Moodle User Interface (UI) Component library, a documentation system used to describe all the Bootstrap components and the custom Moodle components. The component Library is a helper tool for developers when creating user interfaces, a testing tool for theme developers and a documentation tool for core developers. The ultimate goal of having a component library is to encourage developers to create consistent user interfaces to improve Moodle’s overall user experience.&lt;br /&gt;
&lt;br /&gt;
The library contains pages with documentation about User Interface components. It contains details on how to use the component, what variations are available and the JavaScript events / options are associated with the component.&lt;br /&gt;
&lt;br /&gt;
When writing on these pages it is possible to render core mustache templates using some custom syntax like this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; mustache template=&amp;quot;core/notification_error&amp;quot; &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; /mustache &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can also call core JavaScript or use HTML examples where the html code and the rendered result are visible in the Component Library. For more info visit the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-templates/ Moodle templates] page or the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-javascript/ Moodle JavaScript] page.&lt;br /&gt;
&lt;br /&gt;
Each page in the library uses the current css from the default theme in your Moodle installation, if you have multiple themes installed and enabled the setting &amp;quot;Allow theme changes on url&amp;quot;, the component library will have a theme selector option.&lt;br /&gt;
===== Enabling the Component Library =====&lt;br /&gt;
Component library pages are written in the markdown language. These pages need to be compiled to HTML pages before the Component Library is visible. To compile the pages the server running Moodle needs to have the [[Javascript Modules#Install%20NVM%20and%20Node|JavaScript developer tools installed]] (nodeJs and Grunt)&lt;br /&gt;
&lt;br /&gt;
If your server meets all requirements you can enable the library running&lt;br /&gt;
 $ npm install&lt;br /&gt;
 $ grunt componentlibrary&lt;br /&gt;
Further installation instructions can be found in the Component Library itself.&lt;br /&gt;
===== The online version of the Component Library =====&lt;br /&gt;
A hosted version of the Component Library can be found here. http://componentlibrary.moodle.com&lt;br /&gt;
===== Documenting new UI Components =====&lt;br /&gt;
There are no set rules for adding new pages in the component library yet. These rules will need to be written and adopted in the integration process for Moodle code.&lt;br /&gt;
&lt;br /&gt;
As a guideline for making this rules consideration are:&lt;br /&gt;
&lt;br /&gt;
The component library is not about single use components, for example the Moodle grade book (a huge component with many custom features). Or about very common components like buttons, these are already covered by the Bootstrap section of the component library.&lt;br /&gt;
&lt;br /&gt;
New features should be build keeping in mind the UI part needs to be customisable and if possible (and making sense) reusable. And example would be the new page drawers that we are introducing for the Navigation project. Or the custom primary navigation menus where overflowing items are pushed into a More section.&lt;br /&gt;
== Navigation ==&lt;br /&gt;
The core Navigation API has been left mostly untouched. The callbacks to all navigation callbacks remains unchanged and will be called as part of the regular &#039;navigation&#039; and &#039;settingsnav&#039; initialisation. Some new core classes have been created and exist within a new namespace &#039;core/navigation&#039; and serves as conduit to rearrange, cherry-pick existing navigation nodes from the navigation/settingsnav trees and display within the respective navigation type. As such, it is highly recommended to provide unique keys for custom navigation nodes as this helps in the cherry-picking / rearranging process within the new classes.&lt;br /&gt;
===== Primary navigation / Primary Output =====&lt;br /&gt;
The primary navigation(the navbar) apart from the existing content will now display links to the Dashboard, My Courses, Site Admin and Course search, by default. You can still add items to the navbar via the &#039;custom menu&#039; option. This will be displayed within the &#039;More&#039; menu. We have transitioned the menus to be rendered via templates - refer user_menu.mustache. The lang menu has been moved to reside within the user menu.&lt;br /&gt;
===== New view =====&lt;br /&gt;
All settings for courses/modules will now be displayed as tabs within the module. A predefined set of tabs will be shown with any remaining / newly added ones residing within the &#039;Course Admin&#039; page. The settings cog will not be shown anymore. It is recommended to review any settings as some might be displayed as tabs and possibly move them to the tertiary navigation as is done in the core activity modules&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;. At most 5 tabs will be displayed to a user with all the overflow nodes now residing within the &#039;More&#039; menu. Some of the nodes can be hidden by using the new functions defined. &lt;br /&gt;
===== New API functions =====&lt;br /&gt;
====== Page API ======&lt;br /&gt;
* Magic getters to fetch the primary and secondary navs and the primary output.&lt;br /&gt;
* The secondarynav magic getter also checks whether a custom secondary class has been defined within the module&#039;s local\views directory. Use this if you want to deviate from the standard secondary nav structure/order.&lt;br /&gt;
&lt;br /&gt;
* set_secondary_nav - Force override the secondary navigation class&lt;br /&gt;
&lt;br /&gt;
* has_secondary_navigation_setter - Sets the ‘_hassecondarynavigation’ to indicate whether a page should render the secondary navigation&lt;br /&gt;
====== Navigationlib ======&lt;br /&gt;
* set_show_in_secondary_navigation - whether or not a node should be displayed in the secondary nav. Accepts a single boolean argument&lt;br /&gt;
* set_force_into_more_menu- whether or not to force a node into the &#039;More&#039; menu. Accepts a single boolean argument&lt;br /&gt;
===== Changing order of tabs in secondary navigation nodes =====&lt;br /&gt;
Apart from the previously mentioned functions, you can also create a custom secondary class as mentioned earlier. This will automatically be picked by getter and used to render the secondary nav within the activity. E.g. mod_assign/local/views/secondary. Note: This is currently only possible on an activity and block level. &lt;br /&gt;
===== Upcoming changes: =====&lt;br /&gt;
# &amp;lt;sup&amp;gt;1 -&amp;lt;/sup&amp;gt; Complete tertiary nav overhaul for core’s modules - MDL-71912. MDL-71913, MDL-71914, MDL-71915&lt;br /&gt;
# Backwards compatibility for complex deep nested custom navigation. Any custom navigation added by 3rd party devs will now be displayed as flatter structure within a URL select - MDL-72352&lt;br /&gt;
# New module API to inject common content at the top of a module page. The common content would be the title, description and activity information. This solves 2 issues:&lt;br /&gt;
## A centralised location where we can handle #2 and inject it into the relevant page&lt;br /&gt;
## A centralised location where we can inject items particularly activity_information without the need to be replicated in each module. &lt;br /&gt;
== The core_courseformat subsystem ==&lt;br /&gt;
Most of the logic for rendering and editing a course has been moved to a new subsystem called courseformat. The subsystem is located in &amp;quot;course/format&amp;quot; folder so it includes all the format plugins inside. The methods and modules which are distributed between the course and the course/format folders are now rearranged or refactored to be aligned with the current Moodle coding style.&lt;br /&gt;
==== Mandatory renderer in course formats ====&lt;br /&gt;
Now format plugins renderer is not optional anymore. Legacy formats without a renderer will get a deprecation message but it will continue working however, they should create a new renderer as soon as possible. The section-based format can do it by extending the provided core_courseformat\output\section_renderer class which includes all the necessary methods.&lt;br /&gt;
==== New format base class ====&lt;br /&gt;
The old base_format class (which all plugins extend) is now renamed as core_courseformat\base. The new class provides all the functionally of the previous base_format but it has been refactored to be used as a centralized source of truth for the course rendering. Legacy formats should extend the new class to avoid the deprecation message.&lt;br /&gt;
&lt;br /&gt;
Now, the plugin format class provides information such as:&lt;br /&gt;
* If the page is displaying a single or multiple section&lt;br /&gt;
* Give access to other related format objects like the modinfo, the course record, maximum number of sections...&lt;br /&gt;
* If the format is compatible with features like course index, reactive components, ajax...&lt;br /&gt;
* Other format specifics like the page title, the default section name, default blocks...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The format instance is now the main object output components will use to render a course (see next section for more information).&lt;br /&gt;
==== New course output classes and mustache files ====&lt;br /&gt;
Traditionally, section-based course formats uses print_single_section_page and print_multiple_section_page to render the course content. In Moodle 4.0 most of the course rendering methods are migrated to output components and mustache templates. The old methods will get deprecation messages if they use the old renderer methods.&lt;br /&gt;
&lt;br /&gt;
This is an example of a format rendering a course:&amp;lt;syntaxhighlight lang=&amp;quot;php-brief&amp;quot;&amp;gt;&lt;br /&gt;
// Get the course format instance.&lt;br /&gt;
$format = course_get_format($course);&lt;br /&gt;
&lt;br /&gt;
// Get the specific format renderer.&lt;br /&gt;
$renderer = $format-&amp;gt;get_renderer($PAGE);&lt;br /&gt;
&lt;br /&gt;
if (!empty($displaysection)) {&lt;br /&gt;
    // Setup the format instance to display a single section.&lt;br /&gt;
    $format-&amp;gt;set_section_number($displaysection);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create the ouptut instance and render it.&lt;br /&gt;
$outputclass = $format-&amp;gt;get_output_classname(&#039;content&#039;);&lt;br /&gt;
$widget = new $outputclass($format);&lt;br /&gt;
&lt;br /&gt;
echo $renderer-&amp;gt;render($widget);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Format plugins are free to use its own output classes to render a course, or they could override the existing output classes by providing their own implementation. For example, the default output for &amp;quot;content&amp;quot; (as in the previous example) is &amp;quot;core_courseformat\output\local\|content&amp;quot;, however, if the plugin has a &amp;quot;format_XXX\output\courseformat\content&amp;quot; class, the $format-&amp;gt;class the get_output_class will return the overridden one.&lt;br /&gt;
Another important update on course rendering is that now all course structure is rendered using mustache templates instead of the original html_writer methods. Now themes are able to override the course format by providing alternative versions of the mustache files. All core course templates are located in &amp;quot;course/format/templates&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
All the new output classes and a guide on how to migrate the current third-party plugins will be available soon.&lt;br /&gt;
==== Course editor javascript modules and frontend components ====&lt;br /&gt;
The majority of the javascript logic related to the course editing is replaced by AMD modules. Because this is a major change in the way courses are edited and rendered, by default format plugins will continue using the previous YUI modules for now. However, formats can start using the new libraries overriding the &amp;quot;$format-&amp;gt;supports_components()&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Some Moodle 4.0 new features are only available for courses using the new editor library:&lt;br /&gt;
* Edit the course via the course index&lt;br /&gt;
* Creating sections without reloading the course page&lt;br /&gt;
* The new move section/activity modal&lt;br /&gt;
* Native browser drag&amp;amp;drop implementation&lt;br /&gt;
The new course editor uses a component-based reactive pattern to keep track of the course changes. The pattern highlights are:&lt;br /&gt;
* The main AMD module &amp;quot;core_crouseformat\courseeditor&amp;quot; maintains a data structure called state.&lt;br /&gt;
* Each UI element is implemented as a Component that observes the course state data and reacts to any data change&lt;br /&gt;
* When any reactive component needs to modify the course, it asks the course editor to execute a mutation. Mutations encapsulate all web services calls and alter the course state data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reactive library documentation, as well as the format plugin migration guide, will be available soon.&lt;br /&gt;
==== Other course related 4.0 changes ====&lt;br /&gt;
Two new web services have been added:&lt;br /&gt;
* core_courseformat_get_state: user by the new javascript course editor to get the current course state data (containing the list of sections, activities, and other course-related data)&lt;br /&gt;
* core_courseformat_update_course: to alter the current course content. Each call returns the parts of the course state altered by the action&lt;br /&gt;
== API changes ==&lt;br /&gt;
== Behat changes ==&lt;br /&gt;
To make behat tests more readable and easy to maintain, it is recommended to use the most direct steps to get what the test needs. So since MDL-66335 was integrated, and the step was improved in MDL-72179 is highly recommended to use&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
instead of navigating to the activity via&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
Now that [https://docs.moodle.org/dev/Prototypes#Course_creation_improvements Course index] (MDL-71209) is integrated but the project is not stable, these behat steps&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
will fail using Boost theme.&lt;br /&gt;
&lt;br /&gt;
The reason for it is that the drawer used in Boost is hiding the course index. So when the test is trying to follow an &amp;quot;Activity name&amp;quot; link, it finds two different links:&lt;br /&gt;
* one in the course index&lt;br /&gt;
* another one in the course main content.&lt;br /&gt;
But the first one, the one in the course index, is hidden by the drawer, and the test fails.&lt;br /&gt;
&lt;br /&gt;
However the recommended behat steps&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
work &#039;&#039;&#039;fine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Some of the failing behats are fixed in https://github.com/ferranrecio/moodle/commit/c79d58a50b48aa6891ff1d3ba92a7b0ab2393c88#diff-fdf8b0b1eade3b69eaad038de0ddd7c8dec2be7afa32dc693fb929739a49fa9dR32 - MDL-71209&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 And I am on the &amp;quot;Test assignment name&amp;quot; &amp;quot;assign activity&amp;quot; page logged in as teacher1&lt;br /&gt;
instead of:&lt;br /&gt;
 When I log in as &amp;quot;teacher1&amp;quot;&lt;br /&gt;
 And I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 And I follow &amp;quot;Test assignment name&amp;quot;&lt;br /&gt;
== Core plugins review ==&lt;br /&gt;
A few plugins from core Moodle LMS which are no longer or hardly used have been removed and, if appropriate, added to the Moodle plugins directory.&lt;br /&gt;
&lt;br /&gt;
More information about this project, the list of plugins to be removed and the process to follow for keeping them before upgrading to 4.0 can be found in the [[Core plugins review]] page.&lt;br /&gt;
== Site admin presets plugin ==&lt;br /&gt;
The third-party plugin [https://moodle.org/plugins/block_admin_presets Admin presets], created by David Monllaó and maintained by developers from [https://pimenko.com/ Pimenko] has been adapted and integrated into Moodle 4.0. It stores settings and plugins status (enabled/disabled) in what&#039;s called &amp;quot;presets&amp;quot; to let admins quickly switch between different configurations.&lt;br /&gt;
&lt;br /&gt;
More information about this project can be found in the [[Site admin presets|Site admin presets plugin]] page.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61516</id>
		<title>Moodle 4.0 developer update</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61516"/>
		<updated>2021-11-17T13:49:20Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Introduction of a new activity component */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 4.0}}This page highlights the important changes that are coming in Moodle 4.0 for developers. Including how the UX improvements impact custom themes, relevant API changes, and what you can do as developer to prepare for the 4.0 release.&lt;br /&gt;
== Theme changes ==&lt;br /&gt;
The 4.0 theme changes can be classified as changes to improve overall navigation, changes for the course navigation and page, and general UI improvements for Moodle 4.0 and newer only.&lt;br /&gt;
==== Navigation UI changes ====&lt;br /&gt;
A new layout has been added that pushes the blocks region offscreen called the drawers layout. This layout has a fixed width of 800px for the main content area and page buttons to open / close the drawers. Files:&lt;br /&gt;
 /theme/boost/layouts/drawers.php&lt;br /&gt;
 /theme/boost/templates/drawers.mustache&lt;br /&gt;
In case a page uses “fake blocks” (for example book, quiz, calendar, etc.) the drawer region will be opened automatically on first visit.&lt;br /&gt;
&lt;br /&gt;
Child themes implementing this layout should update the theme config.php and configure the ‘drawers’ layout from theme boost for pages like ‘course’ and ‘incourse’&lt;br /&gt;
&lt;br /&gt;
Pages that should not use the drawers layout are the admin pages or other pages that require more horizontal space in the main content area.&lt;br /&gt;
===== Primary / secondary navigation =====&lt;br /&gt;
The top navbar now includes the new &#039;&#039;&#039;primary navigation&#039;&#039;&#039;, this navigation used to be in the page navdrawer region. If custommenu items are configured in the global theme settings they will be added to the primary navigation.&lt;br /&gt;
&lt;br /&gt;
The main content area shows tabs for secondary navigation with a maximum of 5 items being rendered in this ‘more’ menu. A new UI component has been created to render menus like this. Files:&lt;br /&gt;
 /lib/templates/moremenu.mustache&lt;br /&gt;
===== Navigation upcoming changes =====&lt;br /&gt;
===== Edit switch. =====&lt;br /&gt;
MDL-71610&lt;br /&gt;
&lt;br /&gt;
On theme boost the “Turn editing on” and  “Customise this page” buttons have been replaced by an edit switch in the top navbar. Theme Classic will keep using the old buttons. Child themes can choose to use the edit switch if the theme config.php is using this variable&lt;br /&gt;
 $THEME-&amp;gt;haseditswitch = true;&lt;br /&gt;
The languague menu, which used to be rendered in place of the custom menu has moved to the user dropdown when the user is logged in. If not logged in it will be placed next to the search / notification / messaging icon in the top navbar.&lt;br /&gt;
==== Course navigation and the course page ====&lt;br /&gt;
===== Introduction of a new course index component =====&lt;br /&gt;
The new course index feature can be themed using a set of scss variables. Use them to change the look and feel instead of adding custom css&lt;br /&gt;
 /theme/boost/scss/moodle/courseindex.scss&lt;br /&gt;
With the introduction of the course index component, the previous and next links shown underneath each activity are no longer needed and they will be removed.&lt;br /&gt;
===== Introduction of a new activity icons =====&lt;br /&gt;
The icons used for activities have been redesigned and updated for all core moodle activities.&lt;br /&gt;
&lt;br /&gt;
When viewing the new icons in a file manager, for example for the quiz activity, you will see a simple black monochrome icon with a transparent background.&lt;br /&gt;
&lt;br /&gt;
On the course page, or in the activity chooser, the icon will display as a white icon on a coloured background. Styling of the icons on the coursepage is controlled by the css in theme/boost/scss/moodle/icons.scss.&lt;br /&gt;
&lt;br /&gt;
The background colour for activity icons is set using a new variable in function [modname]_supports(). The quiz activity is of type assessment, so in function quiz_supports() there is a new line defining the purpose:&lt;br /&gt;
 case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_ASSESSMENT;&lt;br /&gt;
Available purposes are:&lt;br /&gt;
&lt;br /&gt;
* MOD_PURPOSE_COMMUNICATION&lt;br /&gt;
* MOD_PURPOSE_ASSESSMENT&lt;br /&gt;
* MOD_PURPOSE_COLLABORATION&lt;br /&gt;
* MOD_PURPOSE_CONTENT&lt;br /&gt;
* MOD_PURPOSE_ADMINISTRATION&lt;br /&gt;
* MOD_PURPOSE_ADMINISTRATION&lt;br /&gt;
&lt;br /&gt;
The background colours linked to these purposes are set in theme/boost/scss/moodle/variables.scss&lt;br /&gt;
 $activity-icon-colors: map-merge(&lt;br /&gt;
     (&lt;br /&gt;
         &amp;quot;administration&amp;quot;: #5d63f6,&lt;br /&gt;
         &amp;quot;assessment&amp;quot;: #eb66a2,&lt;br /&gt;
         &amp;quot;collaboration&amp;quot;: #f7634d,&lt;br /&gt;
         &amp;quot;communication&amp;quot;: #11a676,&lt;br /&gt;
         &amp;quot;content&amp;quot;: #399be2,&lt;br /&gt;
         &amp;quot;interface&amp;quot;: #a378ff&lt;br /&gt;
     ),&lt;br /&gt;
     $activity-icon-colors&lt;br /&gt;
 );&lt;br /&gt;
If activity plugins do not define FEATURE_MOD_PURPOSE the activity icon will be rendered against a light grey background. There is no requirement to define the purpose of activity plugins, it will only affect the icon styling.&lt;br /&gt;
&lt;br /&gt;
Customising the activity icon can be done in an alternative way. For example using the styles.css in mod/[pluginname/styles.css&lt;br /&gt;
&lt;br /&gt;
In the example below the activity plugin developer chooses to keep the coloured icon for the activity and render it as large as the coloured background on the core activities&lt;br /&gt;
 .modicon_subcourse.activityiconcontainer {&lt;br /&gt;
     background-color: transparent;&lt;br /&gt;
     padding: 0;&lt;br /&gt;
 }&lt;br /&gt;
  &lt;br /&gt;
 .modicon_subcourse.activityiconcontainer img {&lt;br /&gt;
     width: 50px;&lt;br /&gt;
     height: 50px;&lt;br /&gt;
 }&lt;br /&gt;
To customize all icon colours use this scss array and add it to the ‘Raw initial SCSS’ in the theme Boost advanced settings page. The complete array of icon background colours can be overridden using the ‘Raw initial SCSS’ in the theme settings page. The example below changes the colours of each activity type.&lt;br /&gt;
 $activity-icon-colors: (&lt;br /&gt;
     &amp;quot;administration&amp;quot;: #5D63F6,&lt;br /&gt;
     &amp;quot;assessment&amp;quot;: #11A676,&lt;br /&gt;
     &amp;quot;collaboration&amp;quot;: #EB66A2,&lt;br /&gt;
     &amp;quot;communication&amp;quot;: #F7634D,&lt;br /&gt;
     &amp;quot;content&amp;quot;: #399BE2,&lt;br /&gt;
     &amp;quot;interface&amp;quot;: #A378FF&lt;br /&gt;
 )&lt;br /&gt;
===== General UI improvements upcoming changes =====&lt;br /&gt;
===== Login page =====&lt;br /&gt;
MDL-69371&lt;br /&gt;
&lt;br /&gt;
The login page has been redesigned and allows the admin to configure a background image for the login page only in the theme settings page. This change is available in both Boost and Classic. The login page still has all the features with an improved layout. &lt;br /&gt;
===== The page footer =====&lt;br /&gt;
MDL-71965&lt;br /&gt;
&lt;br /&gt;
In large screens, the page footer button is only visible when clicking a help button at the bottom right of the screen.&lt;br /&gt;
===== User initials as profile picture placeholder =====&lt;br /&gt;
MDL-72305&lt;br /&gt;
&lt;br /&gt;
If users do not upload a profile picture the user initials are displayed on a rounded gray background as a placeholder picture in the top navbar or any other page using a placeholder image. This change will be available in both Boost and Classic. &lt;br /&gt;
&lt;br /&gt;
With the introduction of this placeholder image the full username will no longer be displayed in the top navbar.&lt;br /&gt;
&lt;br /&gt;
===== Removal of back to top link =====&lt;br /&gt;
MDL-72454&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;back to top&amp;quot; link will be removed for theme boost since the new course index reduced the dependence on page scrolling. Also, the new footer is positioned where this component used to be.&lt;br /&gt;
===== Styling changes =====&lt;br /&gt;
By default rounded edges will be used for UI components MDL-72455, for the page header and main content area the borders will be removed MDL-72457. &lt;br /&gt;
== Component library ==&lt;br /&gt;
==== Purpose of the Component Library ====&lt;br /&gt;
Each Moodle installation now ships with a Moodle User Interface (UI) Component library, a documentation system used to describe all the Bootstrap components and the custom Moodle components. The component Library is a helper tool for developers when creating user interfaces, a testing tool for theme developers and a documentation tool for core developers. The ultimate goal of having a component library is to encourage developers to create consistent user interfaces to improve Moodle’s overall user experience.&lt;br /&gt;
&lt;br /&gt;
The library contains pages with documentation about User Interface components. It contains details on how to use the component, what variations are available and the JavaScript events / options are associated with the component.&lt;br /&gt;
&lt;br /&gt;
When writing on these pages it is possible to render core mustache templates using some custom syntax like this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; mustache template=&amp;quot;core/notification_error&amp;quot; &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; /mustache &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can also call core JavaScript or use HTML examples where the html code and the rendered result are visible in the Component Library. For more info visit the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-templates/ Moodle templates] page or the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-javascript/ Moodle JavaScript] page.&lt;br /&gt;
&lt;br /&gt;
Each page in the library uses the current css from the default theme in your Moodle installation, if you have multiple themes installed and enabled the setting &amp;quot;Allow theme changes on url&amp;quot;, the component library will have a theme selector option.&lt;br /&gt;
===== Enabling the Component Library =====&lt;br /&gt;
Component library pages are written in the markdown language. These pages need to be compiled to HTML pages before the Component Library is visible. To compile the pages the server running Moodle needs to have the [[Javascript Modules#Install%20NVM%20and%20Node|JavaScript developer tools installed]] (nodeJs and Grunt)&lt;br /&gt;
&lt;br /&gt;
If your server meets all requirements you can enable the library running&lt;br /&gt;
 $ npm install&lt;br /&gt;
 $ grunt componentlibrary&lt;br /&gt;
Further installation instructions can be found in the Component Library itself.&lt;br /&gt;
===== The online version of the Component Library =====&lt;br /&gt;
A hosted version of the Component Library can be found here. http://componentlibrary.moodle.com&lt;br /&gt;
===== Documenting new UI Components =====&lt;br /&gt;
There are no set rules for adding new pages in the component library yet. These rules will need to be written and adopted in the integration process for Moodle code.&lt;br /&gt;
&lt;br /&gt;
As a guideline for making this rules consideration are:&lt;br /&gt;
&lt;br /&gt;
The component library is not about single use components, for example the Moodle grade book (a huge component with many custom features). Or about very common components like buttons, these are already covered by the Bootstrap section of the component library.&lt;br /&gt;
&lt;br /&gt;
New features should be build keeping in mind the UI part needs to be customisable and if possible (and making sense) reusable. And example would be the new page drawers that we are introducing for the Navigation project. Or the custom primary navigation menus where overflowing items are pushed into a More section.&lt;br /&gt;
== Navigation ==&lt;br /&gt;
The core Navigation API has been left mostly untouched. The callbacks to all navigation callbacks remains unchanged and will be called as part of the regular &#039;navigation&#039; and &#039;settingsnav&#039; initialisation. Some new core classes have been created and exist within a new namespace &#039;core/navigation&#039; and serves as conduit to rearrange, cherry-pick existing navigation nodes from the navigation/settingsnav trees and display within the respective navigation type. As such, it is highly recommended to provide unique keys for custom navigation nodes as this helps in the cherry-picking / rearranging process within the new classes.&lt;br /&gt;
===== Primary navigation / Primary Output =====&lt;br /&gt;
The primary navigation(the navbar) apart from the existing content will now display links to the Dashboard, My Courses, Site Admin and Course search, by default. You can still add items to the navbar via the &#039;custom menu&#039; option. This will be displayed within the &#039;More&#039; menu. We have transitioned the menus to be rendered via templates - refer user_menu.mustache. The lang menu has been moved to reside within the user menu.&lt;br /&gt;
===== New view =====&lt;br /&gt;
All settings for courses/modules will now be displayed as tabs within the module. A predefined set of tabs will be shown with any remaining / newly added ones residing within the &#039;Course Admin&#039; page. The settings cog will not be shown anymore. It is recommended to review any settings as some might be displayed as tabs and possibly move them to the tertiary navigation as is done in the core activity modules&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;. At most 5 tabs will be displayed to a user with all the overflow nodes now residing within the &#039;More&#039; menu. Some of the nodes can be hidden by using the new functions defined. &lt;br /&gt;
===== New API functions =====&lt;br /&gt;
====== Page API ======&lt;br /&gt;
* Magic getters to fetch the primary and secondary navs and the primary output.&lt;br /&gt;
* The secondarynav magic getter also checks whether a custom secondary class has been defined within the module&#039;s local\views directory. Use this if you want to deviate from the standard secondary nav structure/order.&lt;br /&gt;
&lt;br /&gt;
* set_secondary_nav - Force override the secondary navigation class&lt;br /&gt;
&lt;br /&gt;
* has_secondary_navigation_setter - Sets the ‘_hassecondarynavigation’ to indicate whether a page should render the secondary navigation&lt;br /&gt;
====== Navigationlib ======&lt;br /&gt;
* set_show_in_secondary_navigation - whether or not a node should be displayed in the secondary nav. Accepts a single boolean argument&lt;br /&gt;
* set_force_into_more_menu- whether or not to force a node into the &#039;More&#039; menu. Accepts a single boolean argument&lt;br /&gt;
===== Changing order of tabs in secondary navigation nodes =====&lt;br /&gt;
Apart from the previously mentioned functions, you can also create a custom secondary class as mentioned earlier. This will automatically be picked by getter and used to render the secondary nav within the activity. E.g. mod_assign/local/views/secondary. Note: This is currently only possible on an activity and block level. &lt;br /&gt;
===== Upcoming changes: =====&lt;br /&gt;
# &amp;lt;sup&amp;gt;1 -&amp;lt;/sup&amp;gt; Complete tertiary nav overhaul for core’s modules - MDL-71912. MDL-71913, MDL-71914, MDL-71915&lt;br /&gt;
# Backwards compatibility for complex deep nested custom navigation. Any custom navigation added by 3rd party devs will now be displayed as flatter structure within a URL select - MDL-72352&lt;br /&gt;
# New module API to inject common content at the top of a module page. The common content would be the title, description and activity information. This solves 2 issues:&lt;br /&gt;
## A centralised location where we can handle #2 and inject it into the relevant page&lt;br /&gt;
## A centralised location where we can inject items particularly activity_information without the need to be replicated in each module. &lt;br /&gt;
== The core_courseformat subsystem ==&lt;br /&gt;
Most of the logic for rendering and editing a course has been moved to a new subsystem called courseformat. The subsystem is located in &amp;quot;course/format&amp;quot; folder so it includes all the format plugins inside. The methods and modules which are distributed between the course and the course/format folders are now rearranged or refactored to be aligned with the current Moodle coding style.&lt;br /&gt;
==== Mandatory renderer in course formats ====&lt;br /&gt;
Now format plugins renderer is not optional anymore. Legacy formats without a renderer will get a deprecation message but it will continue working however, they should create a new renderer as soon as possible. The section-based format can do it by extending the provided core_courseformat\output\section_renderer class which includes all the necessary methods.&lt;br /&gt;
==== New format base class ====&lt;br /&gt;
The old base_format class (which all plugins extend) is now renamed as core_courseformat\base. The new class provides all the functionally of the previous base_format but it has been refactored to be used as a centralized source of truth for the course rendering. Legacy formats should extend the new class to avoid the deprecation message.&lt;br /&gt;
&lt;br /&gt;
Now, the plugin format class provides information such as:&lt;br /&gt;
* If the page is displaying a single or multiple section&lt;br /&gt;
* Give access to other related format objects like the modinfo, the course record, maximum number of sections...&lt;br /&gt;
* If the format is compatible with features like course index, reactive components, ajax...&lt;br /&gt;
* Other format specifics like the page title, the default section name, default blocks...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The format instance is now the main object output components will use to render a course (see next section for more information).&lt;br /&gt;
==== New course output classes and mustache files ====&lt;br /&gt;
Traditionally, section-based course formats uses print_single_section_page and print_multiple_section_page to render the course content. In Moodle 4.0 most of the course rendering methods are migrated to output components and mustache templates. The old methods will get deprecation messages if they use the old renderer methods.&lt;br /&gt;
&lt;br /&gt;
This is an example of a format rendering a course:&amp;lt;syntaxhighlight lang=&amp;quot;php-brief&amp;quot;&amp;gt;&lt;br /&gt;
// Get the course format instance.&lt;br /&gt;
$format = course_get_format($course);&lt;br /&gt;
&lt;br /&gt;
// Get the specific format renderer.&lt;br /&gt;
$renderer = $format-&amp;gt;get_renderer($PAGE);&lt;br /&gt;
&lt;br /&gt;
if (!empty($displaysection)) {&lt;br /&gt;
    // Setup the format instance to display a single section.&lt;br /&gt;
    $format-&amp;gt;set_section_number($displaysection);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create the ouptut instance and render it.&lt;br /&gt;
$outputclass = $format-&amp;gt;get_output_classname(&#039;content&#039;);&lt;br /&gt;
$widget = new $outputclass($format);&lt;br /&gt;
&lt;br /&gt;
echo $renderer-&amp;gt;render($widget);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Format plugins are free to use its own output classes to render a course, or they could override the existing output classes by providing their own implementation. For example, the default output for &amp;quot;content&amp;quot; (as in the previous example) is &amp;quot;core_courseformat\output\local\|content&amp;quot;, however, if the plugin has a &amp;quot;format_XXX\output\courseformat\content&amp;quot; class, the $format-&amp;gt;class the get_output_class will return the overridden one.&lt;br /&gt;
Another important update on course rendering is that now all course structure is rendered using mustache templates instead of the original html_writer methods. Now themes are able to override the course format by providing alternative versions of the mustache files. All core course templates are located in &amp;quot;course/format/templates&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
All the new output classes and a guide on how to migrate the current third-party plugins will be available soon.&lt;br /&gt;
==== Course editor javascript modules and frontend components ====&lt;br /&gt;
The majority of the javascript logic related to the course editing is replaced by AMD modules. Because this is a major change in the way courses are edited and rendered, by default format plugins will continue using the previous YUI modules for now. However, formats can start using the new libraries overriding the &amp;quot;$format-&amp;gt;supports_components()&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Some Moodle 4.0 new features are only available for courses using the new editor library:&lt;br /&gt;
* Edit the course via the course index&lt;br /&gt;
* Creating sections without reloading the course page&lt;br /&gt;
* The new move section/activity modal&lt;br /&gt;
* Native browser drag&amp;amp;drop implementation&lt;br /&gt;
The new course editor uses a component-based reactive pattern to keep track of the course changes. The pattern highlights are:&lt;br /&gt;
* The main AMD module &amp;quot;core_crouseformat\courseeditor&amp;quot; maintains a data structure called state.&lt;br /&gt;
* Each UI element is implemented as a Component that observes the course state data and reacts to any data change&lt;br /&gt;
* When any reactive component needs to modify the course, it asks the course editor to execute a mutation. Mutations encapsulate all web services calls and alter the course state data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reactive library documentation, as well as the format plugin migration guide, will be available soon.&lt;br /&gt;
==== Other course related 4.0 changes ====&lt;br /&gt;
Two new web services have been added:&lt;br /&gt;
* core_courseformat_get_state: user by the new javascript course editor to get the current course state data (containing the list of sections, activities, and other course-related data)&lt;br /&gt;
* core_courseformat_update_course: to alter the current course content. Each call returns the parts of the course state altered by the action&lt;br /&gt;
== API changes ==&lt;br /&gt;
== Behat changes ==&lt;br /&gt;
To make behat tests more readable and easy to maintain, it is recommended to use the most direct steps to get what the test needs. So since MDL-66335 was integrated, and the step was improved in MDL-72179 is highly recommended to use&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
instead of navigating to the activity via&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
Now that [https://docs.moodle.org/dev/Prototypes#Course_creation_improvements Course index] (MDL-71209) is integrated but the project is not stable, these behat steps&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
will fail using Boost theme.&lt;br /&gt;
&lt;br /&gt;
The reason for it is that the drawer used in Boost is hiding the course index. So when the test is trying to follow an &amp;quot;Activity name&amp;quot; link, it finds two different links:&lt;br /&gt;
* one in the course index&lt;br /&gt;
* another one in the course main content.&lt;br /&gt;
But the first one, the one in the course index, is hidden by the drawer, and the test fails.&lt;br /&gt;
&lt;br /&gt;
However the recommended behat steps&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
work &#039;&#039;&#039;fine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Some of the failing behats are fixed in https://github.com/ferranrecio/moodle/commit/c79d58a50b48aa6891ff1d3ba92a7b0ab2393c88#diff-fdf8b0b1eade3b69eaad038de0ddd7c8dec2be7afa32dc693fb929739a49fa9dR32 - MDL-71209&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 And I am on the &amp;quot;Test assignment name&amp;quot; &amp;quot;assign activity&amp;quot; page logged in as teacher1&lt;br /&gt;
instead of:&lt;br /&gt;
 When I log in as &amp;quot;teacher1&amp;quot;&lt;br /&gt;
 And I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 And I follow &amp;quot;Test assignment name&amp;quot;&lt;br /&gt;
== Core plugins review ==&lt;br /&gt;
A few plugins from core Moodle LMS which are no longer or hardly used have been removed and, if appropriate, added to the Moodle plugins directory.&lt;br /&gt;
&lt;br /&gt;
More information about this project, the list of plugins to be removed and the process to follow for keeping them before upgrading to 4.0 can be found in the [[Core plugins review]] page.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61240</id>
		<title>Moodle 4.0 developer update</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61240"/>
		<updated>2021-09-08T06:45:54Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Edit switch. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 4.0}}This page highlights the important changes that are coming in Moodle 4.0 for developers. Including how the UX improvements impact custom themes, relevant API changes, and what you can do as developer to prepare for the 4.0 release.&lt;br /&gt;
== Theme changes ==&lt;br /&gt;
The 4.0 theme changes can be classified as changes to improve overall navigation, changes for the course navigation and page, and general UI improvements for Moodle 4.0 and newer only.&lt;br /&gt;
==== Navigation UI changes ====&lt;br /&gt;
A new layout has been added that pushes the blocks region offscreen called the drawers layout. This layout has a fixed width of 800px for the main content area and page buttons to open / close the drawers. Files:&lt;br /&gt;
 /theme/boost/layouts/drawers.php&lt;br /&gt;
 /theme/boost/templates/drawers.mustache&lt;br /&gt;
In case a page uses “fake blocks” the drawer region will be opened automatically on first visit.&lt;br /&gt;
&lt;br /&gt;
Child themes implementing this layout should update the theme config.php and configure the ‘drawers’ layout from theme boost for pages like ‘course’ and ‘incourse’&lt;br /&gt;
&lt;br /&gt;
Pages that should not use the drawers layout are the admin pages or other pages that require more horizontal space in the main content area.&lt;br /&gt;
===== Primary / secondary navigation =====&lt;br /&gt;
The top navbar now includes the new &#039;&#039;&#039;primary navigation&#039;&#039;&#039;, this navigation used to be in the page navdrawer region. If custommenu items are configured in the global theme settings they will be added to the primary navigation.&lt;br /&gt;
&lt;br /&gt;
The main content area shows tabs for secondary navigation with a maximum of 5 items being rendered in this ‘more’ menu. A new UI component has been created to render menus like this. Files:&lt;br /&gt;
 /lib/templates/moremenu.mustache&lt;br /&gt;
===== Navigation upcoming changes =====&lt;br /&gt;
===== Edit switch. =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71610 MDL-71610]&lt;br /&gt;
&lt;br /&gt;
On theme boost the “Turn editing on” and  “Customise this page” buttons have been replaced by an edit switch in the top navbar. Theme Classic will keep using the old buttons. Child themes can choose to use the edit switch if the theme config.php is using this variable&lt;br /&gt;
 $THEME-&amp;gt;haseditswitch = true;&lt;br /&gt;
The languague menu, which used to be rendered in place of the custom menu has moved to the user dropdown when the user is logged in. If not logged in it will be placed next to the search / notification / messaging icon in the top navbar.&lt;br /&gt;
==== Course navigation and the course page ====&lt;br /&gt;
===== Introduction of a new course index component =====&lt;br /&gt;
The new course index feature can be themed using a set of scss variables. Use them to change the look and feel instead of adding custom css&lt;br /&gt;
 /theme/boost/scss/moodle/courseindex.scss&lt;br /&gt;
With the introduction of the course index component, the previous and next links shown underneath each activity are no longer needed and they will be removed.&lt;br /&gt;
===== Introduction of a new activity component =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71691 MDL-71691]&lt;br /&gt;
&lt;br /&gt;
The activities in a course are rendered using a new activity UI component. The activities will use a new renderable and can be customised using a single mustache template&lt;br /&gt;
&lt;br /&gt;
The icons used for activities have been redesigned and use a monochrome svg icon. If contrib plugins provide an icon-mono.svg in their pix folder this icon will be rendered. For example :&lt;br /&gt;
 mod/quiz/pix/icon-mono.svg&lt;br /&gt;
The background colour for this icon can be styled using css in a plugin styles.css. Please use one of the theme variables for your icon background using:&lt;br /&gt;
 .modtype_myplugin .inlineiconsvg {&lt;br /&gt;
     background-color: var(--activitytypea);&lt;br /&gt;
 }&lt;br /&gt;
To customize all icon colours use this scss array and add it to the ‘Raw initial SCSS’ in the theme Boost advanced settings page&lt;br /&gt;
&lt;br /&gt;
The complete array can be overridden using the ‘Raw initial SCSS’ in the theme settings page&lt;br /&gt;
 $activity-icon-colors: (&lt;br /&gt;
     &amp;quot;typea&amp;quot;: #5D63F6,&lt;br /&gt;
     &amp;quot;typeb&amp;quot;: #11A676,&lt;br /&gt;
     &amp;quot;typec&amp;quot;: #EB66A2,&lt;br /&gt;
     &amp;quot;typed&amp;quot;: #F7634D,&lt;br /&gt;
     &amp;quot;typee&amp;quot;: #399BE2,&lt;br /&gt;
     &amp;quot;typef&amp;quot;: #A378FF&lt;br /&gt;
 )&lt;br /&gt;
==== General UI improvements upcoming changes ====&lt;br /&gt;
===== Login page =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69371 MDL-69371]&lt;br /&gt;
&lt;br /&gt;
The login page has been redesigned and allows the admin to configure a background image for the login page only in the theme settings page. This change is available in both Boost and Classic. The login page still has all the features with an improved layout. &lt;br /&gt;
===== The page footer =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71965 MDL-71965]&lt;br /&gt;
&lt;br /&gt;
The page footer button is only visible when clicking a help button at the bottom right of the screen &lt;br /&gt;
===== User initials as profile picture placeholder =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72305 MDL-72305]&lt;br /&gt;
&lt;br /&gt;
If users do not upload a profile picture the user initials are displayed on a rounded gray background as a placeholder picture in the top navbar or any other page using a placeholder image. This change will be available in both Boost and Classic. &lt;br /&gt;
&lt;br /&gt;
With the introduction of this placeholder image the full username will no longer be displayed in the top navbar.&lt;br /&gt;
===== Image editable component, single image formfield =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69880 MDL-69880]&lt;br /&gt;
&lt;br /&gt;
When uploading a user image or course image the user can now &#039;&#039;&#039;resize&#039;&#039;&#039; and &#039;&#039;&#039;crop&#039;&#039;&#039; the image. This feature can be reused for any component handling images using a new formfield:&lt;br /&gt;
 $mform-&amp;gt;addElement(&#039;singleimage&#039;).&lt;br /&gt;
This form-field will store a drawer file in the user context. On submitting the form the uploaded file needs to be stored in a more permanent location. The best way of achieving this is creating an image handler class to store / delete / handle form data. For example:&lt;br /&gt;
 course/classes/imageeditable/handler.php&lt;br /&gt;
The image editable component can be used as a standalone feature too using&lt;br /&gt;
 lib/classes/output/image_editable.php&lt;br /&gt;
When used as a standalone component it will allow users to change the profile picture from the user profile page, or update any other image used in a custom plugin or theme.&lt;br /&gt;
===== Removal of back to top link =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72454 MDL-72454]&lt;br /&gt;
&lt;br /&gt;
The back to top link will be removed for theme boost to make place for the page footer button. &lt;br /&gt;
===== Styling changes =====&lt;br /&gt;
By default rounded edges will be used for UI components [https://tracker.moodle.org/browse/MDL-72455 MDL-72455], for the page header and main content area the borders will be removed [https://tracker.moodle.org/browse/MDL-72457 MDL-72457]. &lt;br /&gt;
== Component library ==&lt;br /&gt;
==== Purpose of the Component Library ====&lt;br /&gt;
Each Moodle installation now ships with a Moodle User Interface (UI) Component library, a documentation system used to describe all the Bootstrap components and the custom Moodle components. The component Library is a helper tool for developers when creating user interfaces, a testing tool for theme developers and a documentation tool for core developers. The ultimate goal of having a component library is to encourage developers to create consistent user interfaces to improve Moodle’s overall user experience.&lt;br /&gt;
&lt;br /&gt;
The library contains pages with documentation about User Interface components. It contains details on how to use the component, what variations are available and the JavaScript events / options are associated with the component.&lt;br /&gt;
&lt;br /&gt;
When writing on these pages it is possible to render core mustache templates using some custom syntax like this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; mustache template=&amp;quot;core/notification_error&amp;quot; &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; /mustache &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can also call core JavaScript or use HTML examples where the html code and the rendered result are visible in the Component Library. For more info visit the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-templates/ Moodle templates] page or the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-javascript/ Moodle JavaScript] page.&lt;br /&gt;
&lt;br /&gt;
Each page in the library uses the current css from the default theme in your Moodle installation, if you have multiple themes installed and enabled the setting &amp;quot;Allow theme changes on url&amp;quot;, the component library will have a theme selector option.&lt;br /&gt;
===== Enabling the Component Library =====&lt;br /&gt;
Component library pages are written in the markdown language. These pages need to be compiled to HTML pages before the Component Library is visible. To compile the pages the server running Moodle needs to have the [[Javascript Modules#Install%20NVM%20and%20Node|JavaScript developer tools installed]] (nodeJs and Grunt)&lt;br /&gt;
&lt;br /&gt;
If your server meets all requirements you can enable the library running&lt;br /&gt;
 $ npm install&lt;br /&gt;
 $ grunt componentlibrary&lt;br /&gt;
Further installation instructions can be found in the Component Library itself.&lt;br /&gt;
===== The online version of the Component Library =====&lt;br /&gt;
A hosted version of the Component Library can be found here. http://componentlibrary.moodle.com&lt;br /&gt;
===== Documenting new UI Components =====&lt;br /&gt;
There are no set rules for adding new pages in the component library yet. These rules will need to be written and adopted in the integration process for Moodle code.&lt;br /&gt;
&lt;br /&gt;
As a guideline for making this rules consideration are:&lt;br /&gt;
&lt;br /&gt;
The component library is not about single use components, for example the Moodle grade book (a huge component with many custom features). Or about very common components like buttons, these are already covered by the Bootstrap section of the component library.&lt;br /&gt;
&lt;br /&gt;
New features should be build keeping in mind the UI part needs to be customisable and if possible (and making sense) reusable. And example would be the new page drawers that we are introducing for the Navigation project. Or the custom primary navigation menus where overflowing items are pushed into a More section.&lt;br /&gt;
== Navigation ==&lt;br /&gt;
The core Navigation API has been left mostly untouched. The callbacks to all navigation callbacks remains unchanged and will be called as part of the regular &#039;navigation&#039; and &#039;settingsnav&#039; initialisation. Some new core classes have been created and exist within a new namespace &#039;core/navigation&#039; and serves as conduit to rearrange, cherry-pick existing navigation nodes from the navigation/settingsnav trees and display within the respective navigation type. As such, it is highly recommended to provide unique keys for custom navigation nodes as this helps in the cherry-picking / rearranging process within the new classes.&lt;br /&gt;
===== Primary navigation / Primary Output =====&lt;br /&gt;
The primary navigation(the navbar) apart from the existing content will now display links to the Dashboard, My Courses, Site Admin and Course search, by default. You can still add items to the navbar via the &#039;custom menu&#039; option. This will be displayed within the &#039;More&#039; menu. We have transitioned the menus to be rendered via templates - refer user_menu.mustache. The lang menu has been moved to reside within the user menu.&lt;br /&gt;
===== New view =====&lt;br /&gt;
All settings for courses/modules will now be displayed as tabs within the module. A predefined set of tabs will be shown with any remaining / newly added ones residing within the &#039;Course Admin&#039; page. The settings cog will not be shown anymore. It is recommended to review any settings as some might be displayed as tabs and possibly move them to the tertiary navigation as is done in the core activity modules&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;. At most 5 tabs will be displayed to a user with all the overflow nodes now residing within the &#039;More&#039; menu. Some of the nodes can be hidden by using the new functions defined. &lt;br /&gt;
===== New API functions =====&lt;br /&gt;
====== Page API ======&lt;br /&gt;
* Magic getters to fetch the primary and secondary navs and the primary output.&lt;br /&gt;
* The secondarynav magic getter also checks whether a custom secondary class has been defined within the module&#039;s local\views directory. Use this if you want to deviate from the standard secondary nav structure/order.&lt;br /&gt;
&lt;br /&gt;
* set_secondary_nav - Force override the secondary navigation class&lt;br /&gt;
&lt;br /&gt;
* has_secondary_navigation_setter - Sets the ‘_hassecondarynavigation’ to indicate whether a page should render the secondary navigation&lt;br /&gt;
====== Navigationlib ======&lt;br /&gt;
* set_show_in_secondary_navigation - whether or not a node should be displayed in the secondary nav. Accepts a single boolean argument&lt;br /&gt;
* set_force_into_more_menu- whether or not to force a node into the &#039;More&#039; menu. Accepts a single boolean argument&lt;br /&gt;
===== Changing order of tabs in secondary navigation nodes =====&lt;br /&gt;
Apart from the previously mentioned functions, you can also create a custom secondary class as mentioned earlier. This will automatically be picked by getter and used to render the secondary nav within the activity. E.g. mod_assign/local/views/secondary. Note: This is currently only possible on an activity and block level. &lt;br /&gt;
===== Upcoming changes: =====&lt;br /&gt;
# &amp;lt;sup&amp;gt;1 -&amp;lt;/sup&amp;gt; Complete tertiary nav overhaul for core’s modules - [https://tracker.moodle.org/browse/MDL-71912 MDL-71912]. [https://tracker.moodle.org/browse/MDL-71913 MDL-71913],[https://tracker.moodle.org/browse/MDL-71914 MDL-71914],[https://tracker.moodle.org/browse/MDL-71915 MDL-71915]&lt;br /&gt;
# Backwards compatibility for complex deep nested custom navigation. Any custom navigation added by 3rd party devs will now be displayed as flatter structure within a URL select - [https://tracker.moodle.org/browse/MDL-72352 MDL-72352]&lt;br /&gt;
# New module API to inject common content at the top of a module page. The common content would be the title, description and activity information. This solves 2 issues:&lt;br /&gt;
## A centralised location where we can handle #2 and inject it into the relevant page&lt;br /&gt;
## A centralised location where we can inject items particularly activity_information without the need to be replicated in each module. &lt;br /&gt;
== The core_courseformat subsystem ==&lt;br /&gt;
Most of the logic for rendering and editing a course has been moved to a new subsystem called courseformat. The subsystem is located in &amp;quot;course/format&amp;quot; folder so it includes all the format plugins inside. The methods and modules which are distributed between the course and the course/format folders are now rearranged or refactored to be aligned with the current Moodle coding style.&lt;br /&gt;
==== Mandatory renderer in course formats ====&lt;br /&gt;
Now format plugins renderer is not optional anymore. Legacy formats without a renderer will get a deprecation message but it will continue working however, they should create a new renderer as soon as possible. The section-based format can do it by extending the provided core_courseformat\output\section_renderer class which includes all the necessary methods.&lt;br /&gt;
==== New format base class ====&lt;br /&gt;
The old base_format class (which all plugins extend) is now renamed as core_courseformat\base. The new class provides all the functionally of the previous base_format but it has been refactored to be used as a centralized source of truth for the course rendering. Legacy formats should extend the new class to avoid the deprecation message.&lt;br /&gt;
&lt;br /&gt;
Now, the plugin format class provides information such as:&lt;br /&gt;
* If the page is displaying a single or multiple section&lt;br /&gt;
* Give access to other related format objects like the modinfo, the course record, maximum number of sections...&lt;br /&gt;
* If the format is compatible with features like course index, reactive components, ajax...&lt;br /&gt;
* Other format specifics like the page title, the default section name, default blocks...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The format instance is now the main object output components will use to render a course (see next section for more information).&lt;br /&gt;
==== New course output classes and mustache files ====&lt;br /&gt;
Traditionally, section-based course formats uses print_single_section_page and print_multiple_section_page to render the course content. In Moodle 4.0 most of the course rendering methods are migrated to output components and mustache templates. The old methods will get deprecation messages if they use the old renderer methods.&lt;br /&gt;
&lt;br /&gt;
This is an example of a format rendering a course:&amp;lt;syntaxhighlight lang=&amp;quot;php-brief&amp;quot;&amp;gt;&lt;br /&gt;
// Get the course format instance.&lt;br /&gt;
$format = course_get_format($course);&lt;br /&gt;
&lt;br /&gt;
// Get the specific format renderer.&lt;br /&gt;
$renderer = $format-&amp;gt;get_renderer($PAGE);&lt;br /&gt;
&lt;br /&gt;
if (!empty($displaysection)) {&lt;br /&gt;
    // Setup the format instance to display a single section.&lt;br /&gt;
    $format-&amp;gt;set_section_number($displaysection);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create the ouptut instance and render it.&lt;br /&gt;
$outputclass = $format-&amp;gt;get_output_classname(&#039;content&#039;);&lt;br /&gt;
$widget = new $outputclass($format);&lt;br /&gt;
&lt;br /&gt;
echo $renderer-&amp;gt;render($widget);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Format plugins are free to use its own output classes to render a course, or they could override the existing output classes by providing their own implementation. For example, the default output for &amp;quot;content&amp;quot; (as in the previous example) is &amp;quot;core_courseformat\output\local\|content&amp;quot;, however, if the plugin has a &amp;quot;format_XXX\output\courseformat\content&amp;quot; class, the $format-&amp;gt;class the get_output_class will return the overridden one.&lt;br /&gt;
Another important update on course rendering is that now all course structure is rendered using mustache templates instead of the original html_writer methods. Now themes are able to override the course format by providing alternative versions of the mustache files. All core course templates are located in &amp;quot;course/format/templates&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
All the new output classes and a guide on how to migrate the current third-party plugins will be available soon.&lt;br /&gt;
==== Course editor javascript modules and frontend components ====&lt;br /&gt;
The majority of the javascript logic related to the course editing is replaced by AMD modules. Because this is a major change in the way courses are edited and rendered, by default format plugins will continue using the previous YUI modules for now. However, formats can start using the new libraries overriding the &amp;quot;$format-&amp;gt;supports_components()&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Some Moodle 4.0 new features are only available for courses using the new editor library:&lt;br /&gt;
* Edit the course via the course index&lt;br /&gt;
* Creating sections without reloading the course page&lt;br /&gt;
* The new move section/activity modal&lt;br /&gt;
* Native browser drag&amp;amp;drop implementation&lt;br /&gt;
The new course editor uses a component-based reactive pattern to keep track of the course changes. The pattern highlights are:&lt;br /&gt;
* The main AMD module &amp;quot;core_crouseformat\courseeditor&amp;quot; maintains a data structure called state.&lt;br /&gt;
* Each UI element is implemented as a Component that observes the course state data and reacts to any data change&lt;br /&gt;
* When any reactive component needs to modify the course, it asks the course editor to execute a mutation. Mutations encapsulate all web services calls and alter the course state data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reactive library documentation, as well as the format plugin migration guide, will be available soon.&lt;br /&gt;
==== Other course related 4.0 changes ====&lt;br /&gt;
Two new web services have been added:&lt;br /&gt;
* core_courseformat_get_state: user by the new javascript course editor to get the current course state data (containing the list of sections, activities, and other course-related data)&lt;br /&gt;
* core_courseformat_update_course: to alter the current course content. Each call returns the parts of the course state altered by the action&lt;br /&gt;
== API changes ==&lt;br /&gt;
== Behat changes ==&lt;br /&gt;
To make behat tests more readable and easy to maintain, it is recommended to use the most direct steps to get what the test needs. So since MDL-66335 was integrated, and the step was improved in MDL-72179 is highly recommended to use&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
instead of navigating to the activity via&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
Now that [https://docs.moodle.org/dev/Prototypes#Course_creation_improvements Course index] (MDL-71209) is integrated but the project is not stable, these behat steps&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
will fail using Boost theme.&lt;br /&gt;
&lt;br /&gt;
The reason for it is that the drawer used in Boost is hiding the course index. So when the test is trying to follow an &amp;quot;Activity name&amp;quot; link, it finds two different links:&lt;br /&gt;
* one in the course index&lt;br /&gt;
* another one in the course main content.&lt;br /&gt;
But the first one, the one in the course index, is hidden by the drawer, and the test fails.&lt;br /&gt;
&lt;br /&gt;
However the recommended behat steps&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
work &#039;&#039;&#039;fine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Some of the failing behats are fixed in https://github.com/ferranrecio/moodle/commit/c79d58a50b48aa6891ff1d3ba92a7b0ab2393c88#diff-fdf8b0b1eade3b69eaad038de0ddd7c8dec2be7afa32dc693fb929739a49fa9dR32 - MDL-71209&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 And I am on the &amp;quot;Test assignment name&amp;quot; &amp;quot;assign activity&amp;quot; page logged in as teacher1&lt;br /&gt;
instead of:&lt;br /&gt;
 When I log in as &amp;quot;teacher1&amp;quot;&lt;br /&gt;
 And I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 And I follow &amp;quot;Test assignment name&amp;quot;&lt;br /&gt;
== Core plugins review ==&lt;br /&gt;
A few plugins from core Moodle LMS which are no longer or hardly used have been removed and, if appropriate, added to the Moodle plugins directory.&lt;br /&gt;
&lt;br /&gt;
More information about this project, the list of plugins to be removed and the process to follow for keeping them before upgrading to 4.0 can be found in the [[Core plugins review]] page.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61239</id>
		<title>Moodle 4.0 developer update</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61239"/>
		<updated>2021-09-08T06:44:23Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Primary / secondary navigation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 4.0}}This page highlights the important changes that are coming in Moodle 4.0 for developers. Including how the UX improvements impact custom themes, relevant API changes, and what you can do as developer to prepare for the 4.0 release.&lt;br /&gt;
== Theme changes ==&lt;br /&gt;
The 4.0 theme changes can be classified as changes to improve overall navigation, changes for the course navigation and page, and general UI improvements for Moodle 4.0 and newer only.&lt;br /&gt;
==== Navigation UI changes ====&lt;br /&gt;
A new layout has been added that pushes the blocks region offscreen called the drawers layout. This layout has a fixed width of 800px for the main content area and page buttons to open / close the drawers. Files:&lt;br /&gt;
 /theme/boost/layouts/drawers.php&lt;br /&gt;
 /theme/boost/templates/drawers.mustache&lt;br /&gt;
In case a page uses “fake blocks” the drawer region will be opened automatically on first visit.&lt;br /&gt;
&lt;br /&gt;
Child themes implementing this layout should update the theme config.php and configure the ‘drawers’ layout from theme boost for pages like ‘course’ and ‘incourse’&lt;br /&gt;
&lt;br /&gt;
Pages that should not use the drawers layout are the admin pages or other pages that require more horizontal space in the main content area.&lt;br /&gt;
===== Primary / secondary navigation =====&lt;br /&gt;
The top navbar now includes the new &#039;&#039;&#039;primary navigation&#039;&#039;&#039;, this navigation used to be in the page navdrawer region. If custommenu items are configured in the global theme settings they will be added to the primary navigation.&lt;br /&gt;
&lt;br /&gt;
The main content area shows tabs for secondary navigation with a maximum of 5 items being rendered in this ‘more’ menu. A new UI component has been created to render menus like this. Files:&lt;br /&gt;
 /lib/templates/moremenu.mustache&lt;br /&gt;
===== Navigation upcoming changes =====&lt;br /&gt;
====== Edit switch. ======&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71610 MDL-71610]&lt;br /&gt;
&lt;br /&gt;
On theme boost the “Turn editing on” and  “Customise this page” buttons have been replaced by an edit switch in the top navbar. Theme Classic will keep using the old buttons. Child themes can choose to use the edit switch if the theme config.php is using this variable&lt;br /&gt;
 $THEME-&amp;gt;haseditswitch = true;&lt;br /&gt;
The languague menu, which used to be rendered in place of the custom menu has moved to the user dropdown when the user is logged in. If not logged in it will be placed next to the search / notification / messaging icon in the top navbar.&lt;br /&gt;
&lt;br /&gt;
==== Course navigation and the course page ====&lt;br /&gt;
===== Introduction of a new course index component =====&lt;br /&gt;
The new course index feature can be themed using a set of scss variables. Use them to change the look and feel instead of adding custom css&lt;br /&gt;
 /theme/boost/scss/moodle/courseindex.scss&lt;br /&gt;
With the introduction of the course index component, the previous and next links shown underneath each activity are no longer needed and they will be removed.&lt;br /&gt;
===== Introduction of a new activity component =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71691 MDL-71691]&lt;br /&gt;
&lt;br /&gt;
The activities in a course are rendered using a new activity UI component. The activities will use a new renderable and can be customised using a single mustache template&lt;br /&gt;
&lt;br /&gt;
The icons used for activities have been redesigned and use a monochrome svg icon. If contrib plugins provide an icon-mono.svg in their pix folder this icon will be rendered. For example :&lt;br /&gt;
 mod/quiz/pix/icon-mono.svg&lt;br /&gt;
The background colour for this icon can be styled using css in a plugin styles.css. Please use one of the theme variables for your icon background using:&lt;br /&gt;
 .modtype_myplugin .inlineiconsvg {&lt;br /&gt;
     background-color: var(--activitytypea);&lt;br /&gt;
 }&lt;br /&gt;
To customize all icon colours use this scss array and add it to the ‘Raw initial SCSS’ in the theme Boost advanced settings page&lt;br /&gt;
&lt;br /&gt;
The complete array can be overridden using the ‘Raw initial SCSS’ in the theme settings page&lt;br /&gt;
 $activity-icon-colors: (&lt;br /&gt;
     &amp;quot;typea&amp;quot;: #5D63F6,&lt;br /&gt;
     &amp;quot;typeb&amp;quot;: #11A676,&lt;br /&gt;
     &amp;quot;typec&amp;quot;: #EB66A2,&lt;br /&gt;
     &amp;quot;typed&amp;quot;: #F7634D,&lt;br /&gt;
     &amp;quot;typee&amp;quot;: #399BE2,&lt;br /&gt;
     &amp;quot;typef&amp;quot;: #A378FF&lt;br /&gt;
 )&lt;br /&gt;
==== General UI improvements upcoming changes ====&lt;br /&gt;
===== Login page =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69371 MDL-69371]&lt;br /&gt;
&lt;br /&gt;
The login page has been redesigned and allows the admin to configure a background image for the login page only in the theme settings page. This change is available in both Boost and Classic. The login page still has all the features with an improved layout. &lt;br /&gt;
===== The page footer =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71965 MDL-71965]&lt;br /&gt;
&lt;br /&gt;
The page footer button is only visible when clicking a help button at the bottom right of the screen &lt;br /&gt;
===== User initials as profile picture placeholder =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72305 MDL-72305]&lt;br /&gt;
&lt;br /&gt;
If users do not upload a profile picture the user initials are displayed on a rounded gray background as a placeholder picture in the top navbar or any other page using a placeholder image. This change will be available in both Boost and Classic. &lt;br /&gt;
&lt;br /&gt;
With the introduction of this placeholder image the full username will no longer be displayed in the top navbar.&lt;br /&gt;
===== Image editable component, single image formfield =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69880 MDL-69880]&lt;br /&gt;
&lt;br /&gt;
When uploading a user image or course image the user can now &#039;&#039;&#039;resize&#039;&#039;&#039; and &#039;&#039;&#039;crop&#039;&#039;&#039; the image. This feature can be reused for any component handling images using a new formfield:&lt;br /&gt;
 $mform-&amp;gt;addElement(&#039;singleimage&#039;).&lt;br /&gt;
This form-field will store a drawer file in the user context. On submitting the form the uploaded file needs to be stored in a more permanent location. The best way of achieving this is creating an image handler class to store / delete / handle form data. For example:&lt;br /&gt;
 course/classes/imageeditable/handler.php&lt;br /&gt;
The image editable component can be used as a standalone feature too using&lt;br /&gt;
 lib/classes/output/image_editable.php&lt;br /&gt;
When used as a standalone component it will allow users to change the profile picture from the user profile page, or update any other image used in a custom plugin or theme.&lt;br /&gt;
===== Removal of back to top link =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72454 MDL-72454]&lt;br /&gt;
&lt;br /&gt;
The back to top link will be removed for theme boost to make place for the page footer button. &lt;br /&gt;
===== Styling changes =====&lt;br /&gt;
By default rounded edges will be used for UI components [https://tracker.moodle.org/browse/MDL-72455 MDL-72455], for the page header and main content area the borders will be removed [https://tracker.moodle.org/browse/MDL-72457 MDL-72457]. &lt;br /&gt;
== Component library ==&lt;br /&gt;
==== Purpose of the Component Library ====&lt;br /&gt;
Each Moodle installation now ships with a Moodle User Interface (UI) Component library, a documentation system used to describe all the Bootstrap components and the custom Moodle components. The component Library is a helper tool for developers when creating user interfaces, a testing tool for theme developers and a documentation tool for core developers. The ultimate goal of having a component library is to encourage developers to create consistent user interfaces to improve Moodle’s overall user experience.&lt;br /&gt;
&lt;br /&gt;
The library contains pages with documentation about User Interface components. It contains details on how to use the component, what variations are available and the JavaScript events / options are associated with the component.&lt;br /&gt;
&lt;br /&gt;
When writing on these pages it is possible to render core mustache templates using some custom syntax like this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; mustache template=&amp;quot;core/notification_error&amp;quot; &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; /mustache &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can also call core JavaScript or use HTML examples where the html code and the rendered result are visible in the Component Library. For more info visit the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-templates/ Moodle templates] page or the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-javascript/ Moodle JavaScript] page.&lt;br /&gt;
&lt;br /&gt;
Each page in the library uses the current css from the default theme in your Moodle installation, if you have multiple themes installed and enabled the setting &amp;quot;Allow theme changes on url&amp;quot;, the component library will have a theme selector option.&lt;br /&gt;
===== Enabling the Component Library =====&lt;br /&gt;
Component library pages are written in the markdown language. These pages need to be compiled to HTML pages before the Component Library is visible. To compile the pages the server running Moodle needs to have the [[Javascript Modules#Install%20NVM%20and%20Node|JavaScript developer tools installed]] (nodeJs and Grunt)&lt;br /&gt;
&lt;br /&gt;
If your server meets all requirements you can enable the library running&lt;br /&gt;
 $ npm install&lt;br /&gt;
 $ grunt componentlibrary&lt;br /&gt;
Further installation instructions can be found in the Component Library itself.&lt;br /&gt;
===== The online version of the Component Library =====&lt;br /&gt;
A hosted version of the Component Library can be found here. http://componentlibrary.moodle.com&lt;br /&gt;
===== Documenting new UI Components =====&lt;br /&gt;
There are no set rules for adding new pages in the component library yet. These rules will need to be written and adopted in the integration process for Moodle code.&lt;br /&gt;
&lt;br /&gt;
As a guideline for making this rules consideration are:&lt;br /&gt;
&lt;br /&gt;
The component library is not about single use components, for example the Moodle grade book (a huge component with many custom features). Or about very common components like buttons, these are already covered by the Bootstrap section of the component library.&lt;br /&gt;
&lt;br /&gt;
New features should be build keeping in mind the UI part needs to be customisable and if possible (and making sense) reusable. And example would be the new page drawers that we are introducing for the Navigation project. Or the custom primary navigation menus where overflowing items are pushed into a More section.&lt;br /&gt;
== Navigation ==&lt;br /&gt;
The core Navigation API has been left mostly untouched. The callbacks to all navigation callbacks remains unchanged and will be called as part of the regular &#039;navigation&#039; and &#039;settingsnav&#039; initialisation. Some new core classes have been created and exist within a new namespace &#039;core/navigation&#039; and serves as conduit to rearrange, cherry-pick existing navigation nodes from the navigation/settingsnav trees and display within the respective navigation type. As such, it is highly recommended to provide unique keys for custom navigation nodes as this helps in the cherry-picking / rearranging process within the new classes.&lt;br /&gt;
===== Primary navigation / Primary Output =====&lt;br /&gt;
The primary navigation(the navbar) apart from the existing content will now display links to the Dashboard, My Courses, Site Admin and Course search, by default. You can still add items to the navbar via the &#039;custom menu&#039; option. This will be displayed within the &#039;More&#039; menu. We have transitioned the menus to be rendered via templates - refer user_menu.mustache. The lang menu has been moved to reside within the user menu.&lt;br /&gt;
===== New view =====&lt;br /&gt;
All settings for courses/modules will now be displayed as tabs within the module. A predefined set of tabs will be shown with any remaining / newly added ones residing within the &#039;Course Admin&#039; page. The settings cog will not be shown anymore. It is recommended to review any settings as some might be displayed as tabs and possibly move them to the tertiary navigation as is done in the core activity modules&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;. At most 5 tabs will be displayed to a user with all the overflow nodes now residing within the &#039;More&#039; menu. Some of the nodes can be hidden by using the new functions defined. &lt;br /&gt;
===== New API functions =====&lt;br /&gt;
====== Page API ======&lt;br /&gt;
* Magic getters to fetch the primary and secondary navs and the primary output.&lt;br /&gt;
* The secondarynav magic getter also checks whether a custom secondary class has been defined within the module&#039;s local\views directory. Use this if you want to deviate from the standard secondary nav structure/order.&lt;br /&gt;
&lt;br /&gt;
* set_secondary_nav - Force override the secondary navigation class&lt;br /&gt;
&lt;br /&gt;
* has_secondary_navigation_setter - Sets the ‘_hassecondarynavigation’ to indicate whether a page should render the secondary navigation&lt;br /&gt;
====== Navigationlib ======&lt;br /&gt;
* set_show_in_secondary_navigation - whether or not a node should be displayed in the secondary nav. Accepts a single boolean argument&lt;br /&gt;
* set_force_into_more_menu- whether or not to force a node into the &#039;More&#039; menu. Accepts a single boolean argument&lt;br /&gt;
===== Changing order of tabs in secondary navigation nodes =====&lt;br /&gt;
Apart from the previously mentioned functions, you can also create a custom secondary class as mentioned earlier. This will automatically be picked by getter and used to render the secondary nav within the activity. E.g. mod_assign/local/views/secondary. Note: This is currently only possible on an activity and block level. &lt;br /&gt;
===== Upcoming changes: =====&lt;br /&gt;
# &amp;lt;sup&amp;gt;1 -&amp;lt;/sup&amp;gt; Complete tertiary nav overhaul for core’s modules - [https://tracker.moodle.org/browse/MDL-71912 MDL-71912]. [https://tracker.moodle.org/browse/MDL-71913 MDL-71913],[https://tracker.moodle.org/browse/MDL-71914 MDL-71914],[https://tracker.moodle.org/browse/MDL-71915 MDL-71915]&lt;br /&gt;
# Backwards compatibility for complex deep nested custom navigation. Any custom navigation added by 3rd party devs will now be displayed as flatter structure within a URL select - [https://tracker.moodle.org/browse/MDL-72352 MDL-72352]&lt;br /&gt;
# New module API to inject common content at the top of a module page. The common content would be the title, description and activity information. This solves 2 issues:&lt;br /&gt;
## A centralised location where we can handle #2 and inject it into the relevant page&lt;br /&gt;
## A centralised location where we can inject items particularly activity_information without the need to be replicated in each module. &lt;br /&gt;
== The core_courseformat subsystem ==&lt;br /&gt;
Most of the logic for rendering and editing a course has been moved to a new subsystem called courseformat. The subsystem is located in &amp;quot;course/format&amp;quot; folder so it includes all the format plugins inside. The methods and modules which are distributed between the course and the course/format folders are now rearranged or refactored to be aligned with the current Moodle coding style.&lt;br /&gt;
==== Mandatory renderer in course formats ====&lt;br /&gt;
Now format plugins renderer is not optional anymore. Legacy formats without a renderer will get a deprecation message but it will continue working however, they should create a new renderer as soon as possible. The section-based format can do it by extending the provided core_courseformat\output\section_renderer class which includes all the necessary methods.&lt;br /&gt;
==== New format base class ====&lt;br /&gt;
The old base_format class (which all plugins extend) is now renamed as core_courseformat\base. The new class provides all the functionally of the previous base_format but it has been refactored to be used as a centralized source of truth for the course rendering. Legacy formats should extend the new class to avoid the deprecation message.&lt;br /&gt;
&lt;br /&gt;
Now, the plugin format class provides information such as:&lt;br /&gt;
* If the page is displaying a single or multiple section&lt;br /&gt;
* Give access to other related format objects like the modinfo, the course record, maximum number of sections...&lt;br /&gt;
* If the format is compatible with features like course index, reactive components, ajax...&lt;br /&gt;
* Other format specifics like the page title, the default section name, default blocks...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The format instance is now the main object output components will use to render a course (see next section for more information).&lt;br /&gt;
==== New course output classes and mustache files ====&lt;br /&gt;
Traditionally, section-based course formats uses print_single_section_page and print_multiple_section_page to render the course content. In Moodle 4.0 most of the course rendering methods are migrated to output components and mustache templates. The old methods will get deprecation messages if they use the old renderer methods.&lt;br /&gt;
&lt;br /&gt;
This is an example of a format rendering a course:&amp;lt;syntaxhighlight lang=&amp;quot;php-brief&amp;quot;&amp;gt;&lt;br /&gt;
// Get the course format instance.&lt;br /&gt;
$format = course_get_format($course);&lt;br /&gt;
&lt;br /&gt;
// Get the specific format renderer.&lt;br /&gt;
$renderer = $format-&amp;gt;get_renderer($PAGE);&lt;br /&gt;
&lt;br /&gt;
if (!empty($displaysection)) {&lt;br /&gt;
    // Setup the format instance to display a single section.&lt;br /&gt;
    $format-&amp;gt;set_section_number($displaysection);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create the ouptut instance and render it.&lt;br /&gt;
$outputclass = $format-&amp;gt;get_output_classname(&#039;content&#039;);&lt;br /&gt;
$widget = new $outputclass($format);&lt;br /&gt;
&lt;br /&gt;
echo $renderer-&amp;gt;render($widget);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Format plugins are free to use its own output classes to render a course, or they could override the existing output classes by providing their own implementation. For example, the default output for &amp;quot;content&amp;quot; (as in the previous example) is &amp;quot;core_courseformat\output\local\|content&amp;quot;, however, if the plugin has a &amp;quot;format_XXX\output\courseformat\content&amp;quot; class, the $format-&amp;gt;class the get_output_class will return the overridden one.&lt;br /&gt;
Another important update on course rendering is that now all course structure is rendered using mustache templates instead of the original html_writer methods. Now themes are able to override the course format by providing alternative versions of the mustache files. All core course templates are located in &amp;quot;course/format/templates&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
All the new output classes and a guide on how to migrate the current third-party plugins will be available soon.&lt;br /&gt;
==== Course editor javascript modules and frontend components ====&lt;br /&gt;
The majority of the javascript logic related to the course editing is replaced by AMD modules. Because this is a major change in the way courses are edited and rendered, by default format plugins will continue using the previous YUI modules for now. However, formats can start using the new libraries overriding the &amp;quot;$format-&amp;gt;supports_components()&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Some Moodle 4.0 new features are only available for courses using the new editor library:&lt;br /&gt;
* Edit the course via the course index&lt;br /&gt;
* Creating sections without reloading the course page&lt;br /&gt;
* The new move section/activity modal&lt;br /&gt;
* Native browser drag&amp;amp;drop implementation&lt;br /&gt;
The new course editor uses a component-based reactive pattern to keep track of the course changes. The pattern highlights are:&lt;br /&gt;
* The main AMD module &amp;quot;core_crouseformat\courseeditor&amp;quot; maintains a data structure called state.&lt;br /&gt;
* Each UI element is implemented as a Component that observes the course state data and reacts to any data change&lt;br /&gt;
* When any reactive component needs to modify the course, it asks the course editor to execute a mutation. Mutations encapsulate all web services calls and alter the course state data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reactive library documentation, as well as the format plugin migration guide, will be available soon.&lt;br /&gt;
==== Other course related 4.0 changes ====&lt;br /&gt;
Two new web services have been added:&lt;br /&gt;
* core_courseformat_get_state: user by the new javascript course editor to get the current course state data (containing the list of sections, activities, and other course-related data)&lt;br /&gt;
* core_courseformat_update_course: to alter the current course content. Each call returns the parts of the course state altered by the action&lt;br /&gt;
== API changes ==&lt;br /&gt;
== Behat changes ==&lt;br /&gt;
To make behat tests more readable and easy to maintain, it is recommended to use the most direct steps to get what the test needs. So since MDL-66335 was integrated, and the step was improved in MDL-72179 is highly recommended to use&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
instead of navigating to the activity via&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
Now that [https://docs.moodle.org/dev/Prototypes#Course_creation_improvements Course index] (MDL-71209) is integrated but the project is not stable, these behat steps&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
will fail using Boost theme.&lt;br /&gt;
&lt;br /&gt;
The reason for it is that the drawer used in Boost is hiding the course index. So when the test is trying to follow an &amp;quot;Activity name&amp;quot; link, it finds two different links:&lt;br /&gt;
* one in the course index&lt;br /&gt;
* another one in the course main content.&lt;br /&gt;
But the first one, the one in the course index, is hidden by the drawer, and the test fails.&lt;br /&gt;
&lt;br /&gt;
However the recommended behat steps&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
work &#039;&#039;&#039;fine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Some of the failing behats are fixed in https://github.com/ferranrecio/moodle/commit/c79d58a50b48aa6891ff1d3ba92a7b0ab2393c88#diff-fdf8b0b1eade3b69eaad038de0ddd7c8dec2be7afa32dc693fb929739a49fa9dR32 - MDL-71209&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 And I am on the &amp;quot;Test assignment name&amp;quot; &amp;quot;assign activity&amp;quot; page logged in as teacher1&lt;br /&gt;
instead of:&lt;br /&gt;
 When I log in as &amp;quot;teacher1&amp;quot;&lt;br /&gt;
 And I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 And I follow &amp;quot;Test assignment name&amp;quot;&lt;br /&gt;
== Core plugins review ==&lt;br /&gt;
A few plugins from core Moodle LMS which are no longer or hardly used have been removed and, if appropriate, added to the Moodle plugins directory.&lt;br /&gt;
&lt;br /&gt;
More information about this project, the list of plugins to be removed and the process to follow for keeping them before upgrading to 4.0 can be found in the [[Core plugins review]] page.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61238</id>
		<title>Moodle 4.0 developer update</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61238"/>
		<updated>2021-09-08T06:40:30Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Navigation project changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 4.0}}This page highlights the important changes that are coming in Moodle 4.0 for developers. Including how the UX improvements impact custom themes, relevant API changes, and what you can do as developer to prepare for the 4.0 release.&lt;br /&gt;
== Theme changes ==&lt;br /&gt;
The 4.0 theme changes can be classified as changes to improve overall navigation, changes for the course navigation and page, and general UI improvements for Moodle 4.0 and newer only.&lt;br /&gt;
==== Navigation UI changes ====&lt;br /&gt;
A new layout has been added that pushes the blocks region offscreen called the drawers layout. This layout has a fixed width of 800px for the main content area and page buttons to open / close the drawers. Files:&lt;br /&gt;
 /theme/boost/layouts/drawers.php&lt;br /&gt;
 /theme/boost/templates/drawers.mustache&lt;br /&gt;
In case a page uses “fake blocks” the drawer region will be opened automatically on first visit.&lt;br /&gt;
&lt;br /&gt;
Child themes implementing this layout should update the theme config.php and configure the ‘drawers’ layout from theme boost for pages like ‘course’ and ‘incourse’&lt;br /&gt;
&lt;br /&gt;
Pages that should not use the drawers layout are the admin pages or other pages that require more horizontal space in the main content area.&lt;br /&gt;
===== Primary / secondary navigation =====&lt;br /&gt;
The top navbar now includes the new &#039;&#039;&#039;primary navigation&#039;&#039;&#039;, this navigation used to be in the page navdrawer region. If custommenu items are configured in the global theme settings they will be added to the primary navigation.&lt;br /&gt;
&lt;br /&gt;
The main content area shows tabs for secondary navigation with a maximum of 5 items being rendered in this ‘more’ menu. A new UI component has been created to render menus like this. Files:&lt;br /&gt;
 /lib/templates/moremenu.mustache&lt;br /&gt;
===== Navigation upcoming changes =====&lt;br /&gt;
====== Edit switch. ======&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71610 MDL-71610]&lt;br /&gt;
&lt;br /&gt;
On theme boost the “Turn editing on” and  “Customise this page” buttons have been replaced by an edit switch in the top navbar. Theme Classic will keep using the old buttons. Child themes can choose to use the edit switch if the theme config.php is using this variable&lt;br /&gt;
 $THEME-&amp;gt;haseditswitch = true;&lt;br /&gt;
==== Course navigation and the course page ====&lt;br /&gt;
===== Introduction of a new course index component =====&lt;br /&gt;
The new course index feature can be themed using a set of scss variables. Use them to change the look and feel instead of adding custom css&lt;br /&gt;
 /theme/boost/scss/moodle/courseindex.scss&lt;br /&gt;
With the introduction of the course index component, the previous and next links shown underneath each activity are no longer needed and they will be removed.&lt;br /&gt;
&lt;br /&gt;
===== Introduction of a new activity component =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71691 MDL-71691]&lt;br /&gt;
&lt;br /&gt;
The activities in a course are rendered using a new activity UI component. The activities will use a new renderable and can be customised using a single mustache template&lt;br /&gt;
&lt;br /&gt;
The icons used for activities have been redesigned and use a monochrome svg icon. If contrib plugins provide an icon-mono.svg in their pix folder this icon will be rendered. For example :&lt;br /&gt;
 mod/quiz/pix/icon-mono.svg&lt;br /&gt;
The background colour for this icon can be styled using css in a plugin styles.css. Please use one of the theme variables for your icon background using:&lt;br /&gt;
 .modtype_myplugin .inlineiconsvg {&lt;br /&gt;
     background-color: var(--activitytypea);&lt;br /&gt;
 }&lt;br /&gt;
To customize all icon colours use this scss array and add it to the ‘Raw initial SCSS’ in the theme Boost advanced settings page&lt;br /&gt;
&lt;br /&gt;
The complete array can be overridden using the ‘Raw initial SCSS’ in the theme settings page&lt;br /&gt;
 $activity-icon-colors: (&lt;br /&gt;
     &amp;quot;typea&amp;quot;: #5D63F6,&lt;br /&gt;
     &amp;quot;typeb&amp;quot;: #11A676,&lt;br /&gt;
     &amp;quot;typec&amp;quot;: #EB66A2,&lt;br /&gt;
     &amp;quot;typed&amp;quot;: #F7634D,&lt;br /&gt;
     &amp;quot;typee&amp;quot;: #399BE2,&lt;br /&gt;
     &amp;quot;typef&amp;quot;: #A378FF&lt;br /&gt;
 )&lt;br /&gt;
==== General UI improvements upcoming changes ====&lt;br /&gt;
===== Login page =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69371 MDL-69371]&lt;br /&gt;
&lt;br /&gt;
The login page has been redesigned and allows the admin to configure a background image for the login page only in the theme settings page. This change is available in both Boost and Classic. The login page still has all the features with an improved layout. &lt;br /&gt;
===== The page footer =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71965 MDL-71965]&lt;br /&gt;
&lt;br /&gt;
The page footer button is only visible when clicking a help button at the bottom right of the screen &lt;br /&gt;
===== User initials as profile picture placeholder =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72305 MDL-72305]&lt;br /&gt;
&lt;br /&gt;
If users do not upload a profile picture the user initials are displayed on a rounded gray background as a placeholder picture in the top navbar or any other page using a placeholder image. This change will be available in both Boost and Classic.&lt;br /&gt;
===== Image editable component, single image formfield =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69880 MDL-69880]&lt;br /&gt;
&lt;br /&gt;
When uploading a user image or course image the user can now &#039;&#039;&#039;resize&#039;&#039;&#039; and &#039;&#039;&#039;crop&#039;&#039;&#039; the image. This feature can be reused for any component handling images using a new formfield:&lt;br /&gt;
 $mform-&amp;gt;addElement(&#039;singleimage&#039;).&lt;br /&gt;
This form-field will store a drawer file in the user context. On submitting the form the uploaded file needs to be stored in a more permanent location. The best way of achieving this is creating an image handler class to store / delete / handle form data. For example:&lt;br /&gt;
 course/classes/imageeditable/handler.php&lt;br /&gt;
The image editable component can be used as a standalone feature too using&lt;br /&gt;
 lib/classes/output/image_editable.php&lt;br /&gt;
When used as a standalone component it will allow users to change the profile picture from the user profile page, or update any other image used in a custom plugin or theme.&lt;br /&gt;
===== Removal of back to top link =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72454 MDL-72454]&lt;br /&gt;
&lt;br /&gt;
The back to top link will be removed for theme boost to make place for the page footer button. &lt;br /&gt;
===== Styling changes =====&lt;br /&gt;
By default rounded edges will be used for UI components [https://tracker.moodle.org/browse/MDL-72455 MDL-72455], for the page header and main content area the borders will be removed [https://tracker.moodle.org/browse/MDL-72457 MDL-72457]. &lt;br /&gt;
== Component library ==&lt;br /&gt;
==== Purpose of the Component Library ====&lt;br /&gt;
Each Moodle installation now ships with a Moodle User Interface (UI) Component library, a documentation system used to describe all the Bootstrap components and the custom Moodle components. The component Library is a helper tool for developers when creating user interfaces, a testing tool for theme developers and a documentation tool for core developers. The ultimate goal of having a component library is to encourage developers to create consistent user interfaces to improve Moodle’s overall user experience.&lt;br /&gt;
&lt;br /&gt;
The library contains pages with documentation about User Interface components. It contains details on how to use the component, what variations are available and the JavaScript events / options are associated with the component.&lt;br /&gt;
&lt;br /&gt;
When writing on these pages it is possible to render core mustache templates using some custom syntax like this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; mustache template=&amp;quot;core/notification_error&amp;quot; &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; /mustache &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can also call core JavaScript or use HTML examples where the html code and the rendered result are visible in the Component Library. For more info visit the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-templates/ Moodle templates] page or the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-javascript/ Moodle JavaScript] page.&lt;br /&gt;
&lt;br /&gt;
Each page in the library uses the current css from the default theme in your Moodle installation, if you have multiple themes installed and enabled the setting &amp;quot;Allow theme changes on url&amp;quot;, the component library will have a theme selector option.&lt;br /&gt;
===== Enabling the Component Library =====&lt;br /&gt;
Component library pages are written in the markdown language. These pages need to be compiled to HTML pages before the Component Library is visible. To compile the pages the server running Moodle needs to have the [[Javascript Modules#Install%20NVM%20and%20Node|JavaScript developer tools installed]] (nodeJs and Grunt)&lt;br /&gt;
&lt;br /&gt;
If your server meets all requirements you can enable the library running&lt;br /&gt;
 $ npm install&lt;br /&gt;
 $ grunt componentlibrary&lt;br /&gt;
Further installation instructions can be found in the Component Library itself.&lt;br /&gt;
===== The online version of the Component Library =====&lt;br /&gt;
A hosted version of the Component Library can be found here. http://componentlibrary.moodle.com&lt;br /&gt;
===== Documenting new UI Components =====&lt;br /&gt;
There are no set rules for adding new pages in the component library yet. These rules will need to be written and adopted in the integration process for Moodle code.&lt;br /&gt;
&lt;br /&gt;
As a guideline for making this rules consideration are:&lt;br /&gt;
&lt;br /&gt;
The component library is not about single use components, for example the Moodle grade book (a huge component with many custom features). Or about very common components like buttons, these are already covered by the Bootstrap section of the component library.&lt;br /&gt;
&lt;br /&gt;
New features should be build keeping in mind the UI part needs to be customisable and if possible (and making sense) reusable. And example would be the new page drawers that we are introducing for the Navigation project. Or the custom primary navigation menus where overflowing items are pushed into a More section.&lt;br /&gt;
== Navigation ==&lt;br /&gt;
The core Navigation API has been left mostly untouched. The callbacks to all navigation callbacks remains unchanged and will be called as part of the regular &#039;navigation&#039; and &#039;settingsnav&#039; initialisation. Some new core classes have been created and exist within a new namespace &#039;core/navigation&#039; and serves as conduit to rearrange, cherry-pick existing navigation nodes from the navigation/settingsnav trees and display within the respective navigation type. As such, it is highly recommended to provide unique keys for custom navigation nodes as this helps in the cherry-picking / rearranging process within the new classes.&lt;br /&gt;
===== Primary navigation / Primary Output =====&lt;br /&gt;
The primary navigation(the navbar) apart from the existing content will now display links to the Dashboard, My Courses, Site Admin and Course search, by default. You can still add items to the navbar via the &#039;custom menu&#039; option. This will be displayed within the &#039;More&#039; menu. We have transitioned the menus to be rendered via templates - refer user_menu.mustache. The lang menu has been moved to reside within the user menu.&lt;br /&gt;
===== New view =====&lt;br /&gt;
All settings for courses/modules will now be displayed as tabs within the module. A predefined set of tabs will be shown with any remaining / newly added ones residing within the &#039;Course Admin&#039; page. The settings cog will not be shown anymore. It is recommended to review any settings as some might be displayed as tabs and possibly move them to the tertiary navigation as is done in the core activity modules&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;. At most 5 tabs will be displayed to a user with all the overflow nodes now residing within the &#039;More&#039; menu. Some of the nodes can be hidden by using the new functions defined. &lt;br /&gt;
===== New API functions =====&lt;br /&gt;
====== Page API ======&lt;br /&gt;
* Magic getters to fetch the primary and secondary navs and the primary output.&lt;br /&gt;
* The secondarynav magic getter also checks whether a custom secondary class has been defined within the module&#039;s local\views directory. Use this if you want to deviate from the standard secondary nav structure/order.&lt;br /&gt;
&lt;br /&gt;
* set_secondary_nav - Force override the secondary navigation class&lt;br /&gt;
&lt;br /&gt;
* has_secondary_navigation_setter - Sets the ‘_hassecondarynavigation’ to indicate whether a page should render the secondary navigation&lt;br /&gt;
====== Navigationlib ======&lt;br /&gt;
* set_show_in_secondary_navigation - whether or not a node should be displayed in the secondary nav. Accepts a single boolean argument&lt;br /&gt;
* set_force_into_more_menu- whether or not to force a node into the &#039;More&#039; menu. Accepts a single boolean argument&lt;br /&gt;
===== Changing order of tabs in secondary navigation nodes =====&lt;br /&gt;
Apart from the previously mentioned functions, you can also create a custom secondary class as mentioned earlier. This will automatically be picked by getter and used to render the secondary nav within the activity. E.g. mod_assign/local/views/secondary. Note: This is currently only possible on an activity and block level. &lt;br /&gt;
===== Upcoming changes: =====&lt;br /&gt;
# &amp;lt;sup&amp;gt;1 -&amp;lt;/sup&amp;gt; Complete tertiary nav overhaul for core’s modules - [https://tracker.moodle.org/browse/MDL-71912 MDL-71912]. [https://tracker.moodle.org/browse/MDL-71913 MDL-71913],[https://tracker.moodle.org/browse/MDL-71914 MDL-71914],[https://tracker.moodle.org/browse/MDL-71915 MDL-71915]&lt;br /&gt;
# Backwards compatibility for complex deep nested custom navigation. Any custom navigation added by 3rd party devs will now be displayed as flatter structure within a URL select - [https://tracker.moodle.org/browse/MDL-72352 MDL-72352]&lt;br /&gt;
# New module API to inject common content at the top of a module page. The common content would be the title, description and activity information. This solves 2 issues:&lt;br /&gt;
## A centralised location where we can handle #2 and inject it into the relevant page&lt;br /&gt;
## A centralised location where we can inject items particularly activity_information without the need to be replicated in each module. &lt;br /&gt;
== The core_courseformat subsystem ==&lt;br /&gt;
Most of the logic for rendering and editing a course has been moved to a new subsystem called courseformat. The subsystem is located in &amp;quot;course/format&amp;quot; folder so it includes all the format plugins inside. The methods and modules which are distributed between the course and the course/format folders are now rearranged or refactored to be aligned with the current Moodle coding style.&lt;br /&gt;
==== Mandatory renderer in course formats ====&lt;br /&gt;
Now format plugins renderer is not optional anymore. Legacy formats without a renderer will get a deprecation message but it will continue working however, they should create a new renderer as soon as possible. The section-based format can do it by extending the provided core_courseformat\output\section_renderer class which includes all the necessary methods.&lt;br /&gt;
==== New format base class ====&lt;br /&gt;
The old base_format class (which all plugins extend) is now renamed as core_courseformat\base. The new class provides all the functionally of the previous base_format but it has been refactored to be used as a centralized source of truth for the course rendering. Legacy formats should extend the new class to avoid the deprecation message.&lt;br /&gt;
&lt;br /&gt;
Now, the plugin format class provides information such as:&lt;br /&gt;
* If the page is displaying a single or multiple section&lt;br /&gt;
* Give access to other related format objects like the modinfo, the course record, maximum number of sections...&lt;br /&gt;
* If the format is compatible with features like course index, reactive components, ajax...&lt;br /&gt;
* Other format specifics like the page title, the default section name, default blocks...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The format instance is now the main object output components will use to render a course (see next section for more information).&lt;br /&gt;
==== New course output classes and mustache files ====&lt;br /&gt;
Traditionally, section-based course formats uses print_single_section_page and print_multiple_section_page to render the course content. In Moodle 4.0 most of the course rendering methods are migrated to output components and mustache templates. The old methods will get deprecation messages if they use the old renderer methods.&lt;br /&gt;
&lt;br /&gt;
This is an example of a format rendering a course:&amp;lt;syntaxhighlight lang=&amp;quot;php-brief&amp;quot;&amp;gt;&lt;br /&gt;
// Get the course format instance.&lt;br /&gt;
$format = course_get_format($course);&lt;br /&gt;
&lt;br /&gt;
// Get the specific format renderer.&lt;br /&gt;
$renderer = $format-&amp;gt;get_renderer($PAGE);&lt;br /&gt;
&lt;br /&gt;
if (!empty($displaysection)) {&lt;br /&gt;
    // Setup the format instance to display a single section.&lt;br /&gt;
    $format-&amp;gt;set_section_number($displaysection);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create the ouptut instance and render it.&lt;br /&gt;
$outputclass = $format-&amp;gt;get_output_classname(&#039;content&#039;);&lt;br /&gt;
$widget = new $outputclass($format);&lt;br /&gt;
&lt;br /&gt;
echo $renderer-&amp;gt;render($widget);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Format plugins are free to use its own output classes to render a course, or they could override the existing output classes by providing their own implementation. For example, the default output for &amp;quot;content&amp;quot; (as in the previous example) is &amp;quot;core_courseformat\output\local\|content&amp;quot;, however, if the plugin has a &amp;quot;format_XXX\output\courseformat\content&amp;quot; class, the $format-&amp;gt;class the get_output_class will return the overridden one.&lt;br /&gt;
Another important update on course rendering is that now all course structure is rendered using mustache templates instead of the original html_writer methods. Now themes are able to override the course format by providing alternative versions of the mustache files. All core course templates are located in &amp;quot;course/format/templates&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
All the new output classes and a guide on how to migrate the current third-party plugins will be available soon.&lt;br /&gt;
==== Course editor javascript modules and frontend components ====&lt;br /&gt;
The majority of the javascript logic related to the course editing is replaced by AMD modules. Because this is a major change in the way courses are edited and rendered, by default format plugins will continue using the previous YUI modules for now. However, formats can start using the new libraries overriding the &amp;quot;$format-&amp;gt;supports_components()&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Some Moodle 4.0 new features are only available for courses using the new editor library:&lt;br /&gt;
* Edit the course via the course index&lt;br /&gt;
* Creating sections without reloading the course page&lt;br /&gt;
* The new move section/activity modal&lt;br /&gt;
* Native browser drag&amp;amp;drop implementation&lt;br /&gt;
The new course editor uses a component-based reactive pattern to keep track of the course changes. The pattern highlights are:&lt;br /&gt;
* The main AMD module &amp;quot;core_crouseformat\courseeditor&amp;quot; maintains a data structure called state.&lt;br /&gt;
* Each UI element is implemented as a Component that observes the course state data and reacts to any data change&lt;br /&gt;
* When any reactive component needs to modify the course, it asks the course editor to execute a mutation. Mutations encapsulate all web services calls and alter the course state data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reactive library documentation, as well as the format plugin migration guide, will be available soon.&lt;br /&gt;
==== Other course related 4.0 changes ====&lt;br /&gt;
Two new web services have been added:&lt;br /&gt;
* core_courseformat_get_state: user by the new javascript course editor to get the current course state data (containing the list of sections, activities, and other course-related data)&lt;br /&gt;
* core_courseformat_update_course: to alter the current course content. Each call returns the parts of the course state altered by the action&lt;br /&gt;
== API changes ==&lt;br /&gt;
== Behat changes ==&lt;br /&gt;
To make behat tests more readable and easy to maintain, it is recommended to use the most direct steps to get what the test needs. So since MDL-66335 was integrated, and the step was improved in MDL-72179 is highly recommended to use&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
instead of navigating to the activity via&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
Now that [https://docs.moodle.org/dev/Prototypes#Course_creation_improvements Course index] (MDL-71209) is integrated but the project is not stable, these behat steps&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
will fail using Boost theme.&lt;br /&gt;
&lt;br /&gt;
The reason for it is that the drawer used in Boost is hiding the course index. So when the test is trying to follow an &amp;quot;Activity name&amp;quot; link, it finds two different links:&lt;br /&gt;
* one in the course index&lt;br /&gt;
* another one in the course main content.&lt;br /&gt;
But the first one, the one in the course index, is hidden by the drawer, and the test fails.&lt;br /&gt;
&lt;br /&gt;
However the recommended behat steps&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
work &#039;&#039;&#039;fine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Some of the failing behats are fixed in https://github.com/ferranrecio/moodle/commit/c79d58a50b48aa6891ff1d3ba92a7b0ab2393c88#diff-fdf8b0b1eade3b69eaad038de0ddd7c8dec2be7afa32dc693fb929739a49fa9dR32 - MDL-71209&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 And I am on the &amp;quot;Test assignment name&amp;quot; &amp;quot;assign activity&amp;quot; page logged in as teacher1&lt;br /&gt;
instead of:&lt;br /&gt;
 When I log in as &amp;quot;teacher1&amp;quot;&lt;br /&gt;
 And I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 And I follow &amp;quot;Test assignment name&amp;quot;&lt;br /&gt;
== Core plugins review ==&lt;br /&gt;
A few plugins from core Moodle LMS which are no longer or hardly used have been removed and, if appropriate, added to the Moodle plugins directory.&lt;br /&gt;
&lt;br /&gt;
More information about this project, the list of plugins to be removed and the process to follow for keeping them before upgrading to 4.0 can be found in the [[Core plugins review]] page.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61230</id>
		<title>Moodle 4.0 developer update</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61230"/>
		<updated>2021-09-07T14:23:15Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: component library docs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 4.0}}This page will highlight the important changes that are coming in Moodle 4.0 for developers. Including how the UX improvements impact custom themes, relevant API changes, and what you can do as developer to prepare for the 4.0 release.&lt;br /&gt;
== UX and theme changes ==&lt;br /&gt;
The 4.0 theme changes can be classified as changes to improve navigation, changes for the course creation project and general UI improvements for Moodle 4.0 and newer only.&lt;br /&gt;
==== Navigation project changes ====&lt;br /&gt;
A new layout has been added that pushes the blocks region offscreen called the drawers layout. This layout has a fixed width of 800px for the main content area and page buttons to open / close the drawers. Files:&lt;br /&gt;
 /theme/boost/layouts/drawers.php&lt;br /&gt;
 /theme/boost/templates/drawers.mustache&lt;br /&gt;
In case a page uses “fake blocks” the drawer region will be opened automatically on first visit.&lt;br /&gt;
&lt;br /&gt;
Child themes implementing this layout should update the theme config.php and configure the ‘drawers’ layout from theme boost for pages like ‘course’ and ‘incourse’&lt;br /&gt;
&lt;br /&gt;
Pages that should not use the drawers layout are the admin pages or other pages that require more horizontal space in the main content area.&lt;br /&gt;
===== Primary / secondary navigation =====&lt;br /&gt;
The top navbar now includes the new &#039;&#039;&#039;primary navigation&#039;&#039;&#039;, this navigation used to be in the page navdrawer region. If custommenu items are configured in the global theme settings they will be added to the primary navigation.&lt;br /&gt;
&lt;br /&gt;
The main content area shows tabs for secondary navigation with a maximum of 5 items being rendered in this ‘more’ menu. A new UI component has been created to render menus like this. Files:&lt;br /&gt;
 /lib/templates/moremenu.mustache&lt;br /&gt;
===== Navigation project Upcoming changes =====&lt;br /&gt;
====== Edit switch. ======&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71610 MDL-71610]&lt;br /&gt;
&lt;br /&gt;
On theme boost the “Turn editing on” and  “Customise this page” buttons have been replaced by an edit switch in the top navbar. Theme Classic will keep using the old buttons. Child themes can choose to use the edit switch if the theme config.php is using this variable&lt;br /&gt;
 $THEME-&amp;gt;haseditswitch = true;&lt;br /&gt;
==== Create a course project changes ====&lt;br /&gt;
The new course index feature can be themed using a set of scss variables. Use them to change the look and feel instead of adding custom css&lt;br /&gt;
 /theme/boost/scss/moodle/courseindex.scss&lt;br /&gt;
===== Create a course project upcoming changes =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71691 MDL-71691]&lt;br /&gt;
&lt;br /&gt;
The activities in a course are rendered using a new activity UI component. The activities will use a new renderable and can be customised using a single mustache template&lt;br /&gt;
&lt;br /&gt;
The icons used for activities have been redesigned and use a monochrome svg icon. If contrib plugins provide an icon-mono.svg in their pix folder this icon will be rendered. For example :&lt;br /&gt;
 mod/quiz/pix/icon-mono.svg&lt;br /&gt;
The background colour for this icon can be styled using css in a plugin styles.css. Please use one of the theme variables for your icon background using:&lt;br /&gt;
 .modtype_myplugin .inlineiconsvg {&lt;br /&gt;
     background-color: var(--activitytypea);&lt;br /&gt;
 }&lt;br /&gt;
To customize all icon colours use this scss array and add it to the ‘Raw initial SCSS’ in the theme Boost advanced settings page&lt;br /&gt;
&lt;br /&gt;
The complete array can be overridden using the ‘Raw initial SCSS’ in the theme settings page&lt;br /&gt;
 $activity-icon-colors: (&lt;br /&gt;
     &amp;quot;typea&amp;quot;: #5D63F6,&lt;br /&gt;
     &amp;quot;typeb&amp;quot;: #11A676,&lt;br /&gt;
     &amp;quot;typec&amp;quot;: #EB66A2,&lt;br /&gt;
     &amp;quot;typed&amp;quot;: #F7634D,&lt;br /&gt;
     &amp;quot;typee&amp;quot;: #399BE2,&lt;br /&gt;
     &amp;quot;typef&amp;quot;: #A378FF&lt;br /&gt;
 )&lt;br /&gt;
==== General UI improvements upcoming changes ====&lt;br /&gt;
===== Login page =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69371 MDL-69371]&lt;br /&gt;
&lt;br /&gt;
The login page has been redesigned and allows the admin to configure a background image for the login page only in the theme settings page. This change is available in both Boost and Classic. The login page still has all the features with an improved layout. &lt;br /&gt;
===== The page footer =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71965 MDL-71965]&lt;br /&gt;
&lt;br /&gt;
The page footer button is only visible when clicking a help button at the bottom right of the screen &lt;br /&gt;
===== User initials as profile picture placeholder =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72305 MDL-72305]&lt;br /&gt;
&lt;br /&gt;
If users do not upload a profile picture the user initials are displayed on a rounded gray background as a placeholder picture in the top navbar or any other page using a placeholder image. This change will be available in both Boost and Classic.&lt;br /&gt;
===== Image editable component, single image formfield =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69880 MDL-69880]&lt;br /&gt;
&lt;br /&gt;
When uploading a user image or course image the user can now &#039;&#039;&#039;resize&#039;&#039;&#039; and &#039;&#039;&#039;crop&#039;&#039;&#039; the image. This feature can be reused for any component handling images using a new formfield:&lt;br /&gt;
 $mform-&amp;gt;addElement(&#039;singleimage&#039;).&lt;br /&gt;
This form-field will store a drawer file in the user context. On submitting the form the uploaded file needs to be stored in a more permanent location. The best way of achieving this is creating an image handler class to store / delete / handle form data. For example:&lt;br /&gt;
 course/classes/imageeditable/handler.php&lt;br /&gt;
The image editable component can be used as a standalone feature too using&lt;br /&gt;
 lib/classes/output/image_editable.php&lt;br /&gt;
When used as a standalone component it will allow users to change the profile picture from the user profile page, or update any other image used in a custom plugin or theme.&lt;br /&gt;
===== Removal of back to top link =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72454 MDL-72454]&lt;br /&gt;
&lt;br /&gt;
The back to top link will be removed for theme boost to make place for the page footer button. &lt;br /&gt;
===== Theme Boost styling changes =====&lt;br /&gt;
By default rounded edges will be used for UI components [https://tracker.moodle.org/browse/MDL-72455 MDL-72455], for the page header and main content area the borders will be removed [https://tracker.moodle.org/browse/MDL-72457 MDL-72457]. &lt;br /&gt;
== Component library ==&lt;br /&gt;
&lt;br /&gt;
==== Purpose of the Component Library ====&lt;br /&gt;
Each Moodle installation now ships with a Moodle User Interface (UI) Component library, a documentation system used to describe all the Bootstrap components and the custom Moodle components. The component Library is a helper tool for developers when creating user interfaces, a testing tool for theme developers and a documentation tool for core developers. The ultimate goal of having a component library is to encourage developers to create consistent user interfaces to improve Moodle’s overall user experience.&lt;br /&gt;
&lt;br /&gt;
The library contains pages with documentation about User Interface components. It contains details on how to use the component, what variations are available and the JavaScript events / options are associated with the component.&lt;br /&gt;
&lt;br /&gt;
When writing on these pages it is possible to render core mustache templates  using some custom syntax like this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; mustache template=&amp;quot;core/notification_error&amp;quot; &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{{&amp;lt; /mustache &amp;gt;}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You can also call core JavaScript or use HTML examples where the html code and the rendered result are visible in the Component Library. For more info visit the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-templates/ Moodle templates] page or the [http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/moodle-javascript/ Moodle JavaScript] page.&lt;br /&gt;
&lt;br /&gt;
Each page in the library uses the current css from the default theme in your Moodle installation, if you have multiple themes installed and enabled the setting &amp;quot;Allow theme changes on url&amp;quot;, the component library will have a theme selector option.&lt;br /&gt;
&lt;br /&gt;
===== Enabling the Component Library =====&lt;br /&gt;
Component library pages are written in the markdown language. These pages need to be compiled to HTML pages before the Component Library is visible. To compile the pages the server running Moodle needs to have the [[Javascript Modules#Install%20NVM%20and%20Node|JavaScript developer tools installed]] (nodeJs and Grunt)&lt;br /&gt;
&lt;br /&gt;
If your server meets all requirements you can enable the library running&lt;br /&gt;
 $ npm install&lt;br /&gt;
 $ grunt componentlibrary&lt;br /&gt;
Further installation instructions can be found in the Component Library itself.&lt;br /&gt;
&lt;br /&gt;
===== The online version of the Component Library =====&lt;br /&gt;
A hosted version of the Component Library can be found here. http://componentlibrary.moodle.com&lt;br /&gt;
&lt;br /&gt;
===== Documenting new UI Components =====&lt;br /&gt;
There are no set rules for adding new pages in the component library yet. These rules will need to be written and adopted in the integration process for Moodle code.&lt;br /&gt;
&lt;br /&gt;
As a guideline for making this rules consideration are:&lt;br /&gt;
&lt;br /&gt;
The component library is not about single use components, for example the Moodle grade book (a huge component with many custom features). Or about very common components like buttons, these are already covered by the Bootstrap section of the component library.&lt;br /&gt;
&lt;br /&gt;
New features should be build keeping in mind the UI part needs to be customisable and if possible (and making sense) reusable. And example would be the new page drawers that we are introducing for the Navigation project. Or the custom primary navigation menus where overflowing items are pushed into a More section.&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
The core Navigation API has been left mostly untouched. The callbacks to all navigation callbacks remains unchanged and will be called as part of the regular &#039;navigation&#039; and &#039;settingsnav&#039; initialisation. Some new core classes have been created and exist within a new namespace &#039;core/navigation&#039; and serves as conduit to rearrange, cherry-pick existing navigation nodes from the navigation/settingsnav trees and display within the respective navigation type. As such, it is highly recommended to provide unique keys for custom navigation nodes as this helps in the cherry-picking / rearranging process within the new classes.&lt;br /&gt;
===== Primary navigation / Primary Output =====&lt;br /&gt;
The primary navigation(the navbar) apart from the existing content will now display links to the Dashboard, My Courses, Site Admin and Course search, by default. You can still add items to the navbar via the &#039;custom menu&#039; option. This will be displayed within the &#039;More&#039; menu. We have transitioned the menus to be rendered via templates - refer user_menu.mustache. The lang menu has been moved to reside within the user menu.&lt;br /&gt;
===== New view =====&lt;br /&gt;
All settings for courses/modules will now be displayed as tabs within the module. A predefined set of tabs will be shown with any remaining / newly added ones residing within the &#039;Course Admin&#039; page. The settings cog will not be shown anymore. It is recommended to review any settings as some might be displayed as tabs and possibly move them to the tertiary navigation as is done in the core activity modules&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;. At most 5 tabs will be displayed to a user with all the overflow nodes now residing within the &#039;More&#039; menu. Some of the nodes can be hidden by using the new functions defined. &lt;br /&gt;
===== New API functions =====&lt;br /&gt;
====== Page API ======&lt;br /&gt;
* Magic getters to fetch the primary and secondary navs and the primary output.&lt;br /&gt;
* The secondarynav magic getter also checks whether a custom secondary class has been defined within the module&#039;s local\views directory. Use this if you want to deviate from the standard secondary nav structure/order.&lt;br /&gt;
&lt;br /&gt;
* set_secondary_nav - Force override the secondary navigation class&lt;br /&gt;
&lt;br /&gt;
* has_secondary_navigation_setter - Sets the ‘_hassecondarynavigation’ to indicate whether a page should render the secondary navigation&lt;br /&gt;
====== Navigationlib ======&lt;br /&gt;
* set_show_in_secondary_navigation - whether or not a node should be displayed in the secondary nav. Accepts a single boolean argument&lt;br /&gt;
* set_force_into_more_menu- whether or not to force a node into the &#039;More&#039; menu. Accepts a single boolean argument&lt;br /&gt;
===== Changing order of tabs in secondary navigation nodes =====&lt;br /&gt;
Apart from the previously mentioned functions, you can also create a custom secondary class as mentioned earlier. This will automatically be picked by getter and used to render the secondary nav within the activity. E.g. mod_assign/local/views/secondary. Note: This is currently only possible on an activity and block level. &lt;br /&gt;
===== Upcoming changes: =====&lt;br /&gt;
# &amp;lt;sup&amp;gt;1 -&amp;lt;/sup&amp;gt; Complete tertiary nav overhaul for core’s modules - [https://tracker.moodle.org/browse/MDL-71912 MDL-71912]. [https://tracker.moodle.org/browse/MDL-71913 MDL-71913],[https://tracker.moodle.org/browse/MDL-71914 MDL-71914],[https://tracker.moodle.org/browse/MDL-71915 MDL-71915]&lt;br /&gt;
# Backwards compatibility for complex deep nested custom navigation. Any custom navigation added by 3rd party devs will now be displayed as flatter structure within a URL select - [https://tracker.moodle.org/browse/MDL-72352 MDL-72352]&lt;br /&gt;
# New module API to inject common content at the top of a module page. The common content would be the title, description and activity information. This solves 2 issues:&lt;br /&gt;
## A centralised location where we can handle #2 and inject it into the relevant page&lt;br /&gt;
## A centralised location where we can inject items particularly activity_information without the need to be replicated in each module. &lt;br /&gt;
== The core_courseformat subsystem ==&lt;br /&gt;
Most of the logic for rendering and editing a course has been moved to a new subsystem called courseformat. The subsystem is located in &amp;quot;course/format&amp;quot; folder so it includes all the format plugins inside. The methods and modules which are distributed between the course and the course/format folders are now rearranged or refactored to be aligned with the current Moodle coding style.&lt;br /&gt;
==== Mandatory renderer in course formats ====&lt;br /&gt;
Now format plugins renderer is not optional anymore. Legacy formats without a renderer will get a deprecation message but it will continue working however, they should create a new renderer as soon as possible. The section-based format can do it by extending the provided core_courseformat\output\section_renderer class which includes all the necessary methods.&lt;br /&gt;
==== New format base class ====&lt;br /&gt;
The old base_format class (which all plugins extend) is now renamed as core_courseformat\base. The new class provides all the functionally of the previous base_format but it has been refactored to be used as a centralized source of truth for the course rendering. Legacy formats should extend the new class to avoid the deprecation message.&lt;br /&gt;
&lt;br /&gt;
Now, the plugin format class provides information such as:&lt;br /&gt;
* If the page is displaying a single or multiple section&lt;br /&gt;
* Give access to other related format objects like the modinfo, the course record, maximum number of sections...&lt;br /&gt;
* If the format is compatible with features like course index, reactive components, ajax...&lt;br /&gt;
* Other format specifics like the page title, the default section name, default blocks...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The format instance is now the main object output components will use to render a course (see next section for more information).&lt;br /&gt;
==== New course output classes and mustache files ====&lt;br /&gt;
Traditionally, section-based course formats uses print_single_section_page and print_multiple_section_page to render the course content. In Moodle 4.0 most of the course rendering methods are migrated to output components and mustache templates. The old methods will get deprecation messages if they use the old renderer methods.&lt;br /&gt;
&lt;br /&gt;
This is an example of a format rendering a course:&amp;lt;syntaxhighlight lang=&amp;quot;php-brief&amp;quot;&amp;gt;&lt;br /&gt;
// Get the course format instance.&lt;br /&gt;
$format = course_get_format($course);&lt;br /&gt;
&lt;br /&gt;
// Get the specific format renderer.&lt;br /&gt;
$renderer = $format-&amp;gt;get_renderer($PAGE);&lt;br /&gt;
&lt;br /&gt;
if (!empty($displaysection)) {&lt;br /&gt;
    // Setup the format instance to display a single section.&lt;br /&gt;
    $format-&amp;gt;set_section_number($displaysection);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create the ouptut instance and render it.&lt;br /&gt;
$outputclass = $format-&amp;gt;get_output_classname(&#039;content&#039;);&lt;br /&gt;
$widget = new $outputclass($format);&lt;br /&gt;
&lt;br /&gt;
echo $renderer-&amp;gt;render($widget);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Format plugins are free to use its own output classes to render a course, or they could override the existing output classes by providing their own implementation. For example, the default output for &amp;quot;content&amp;quot; (as in the previous example) is &amp;quot;core_courseformat\output\local\|content&amp;quot;, however, if the plugin has a &amp;quot;format_XXX\output\courseformat\content&amp;quot; class, the $format-&amp;gt;class the get_output_class will return the overridden one.&lt;br /&gt;
Another important update on course rendering is that now all course structure is rendered using mustache templates instead of the original html_writer methods. Now themes are able to override the course format by providing alternative versions of the mustache files. All core course templates are located in &amp;quot;course/format/templates&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
All the new output classes and a guide on how to migrate the current third-party plugins will be available soon.&lt;br /&gt;
==== Course editor javascript modules and frontend components ====&lt;br /&gt;
The majority of the javascript logic related to the course editing is replaced by AMD modules. Because this is a major change in the way courses are edited and rendered, by default format plugins will continue using the previous YUI modules for now. However, formats can start using the new libraries overriding the &amp;quot;$format-&amp;gt;supports_components()&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Some Moodle 4.0 new features are only available for courses using the new editor library:&lt;br /&gt;
* Edit the course via the course index&lt;br /&gt;
* Creating sections without reloading the course page&lt;br /&gt;
* The new move section/activity modal&lt;br /&gt;
* Native browser drag&amp;amp;drop implementation&lt;br /&gt;
The new course editor uses a component-based reactive pattern to keep track of the course changes. The pattern highlights are:&lt;br /&gt;
* The main AMD module &amp;quot;core_crouseformat\courseeditor&amp;quot; maintains a data structure called state.&lt;br /&gt;
* Each UI element is implemented as a Component that observes the course state data and reacts to any data change&lt;br /&gt;
* When any reactive component needs to modify the course, it asks the course editor to execute a mutation. Mutations encapsulate all web services calls and alter the course state data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reactive library documentation, as well as the format plugin migration guide, will be available soon.&lt;br /&gt;
==== Other course related 4.0 changes ====&lt;br /&gt;
Two new web services have been added:&lt;br /&gt;
* core_courseformat_get_state: user by the new javascript course editor to get the current course state data (containing the list of sections, activities, and other course-related data)&lt;br /&gt;
* core_courseformat_update_course: to alter the current course content. Each call returns the parts of the course state altered by the action&lt;br /&gt;
== API changes ==&lt;br /&gt;
== Behat changes ==&lt;br /&gt;
To make behat tests more readable and easy to maintain, it is recommended to use the most direct steps to get what the test needs. So since MDL-66335 was integrated, and the step was improved in MDL-72179 is highly recommended to use&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
instead of navigating to the activity via&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
Now that [https://docs.moodle.org/dev/Prototypes#Course_creation_improvements Course index] (MDL-71209) is integrated but the project is not stable, these behat steps&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
will fail using Boost theme.&lt;br /&gt;
&lt;br /&gt;
The reason for it is that the drawer used in Boost is hiding the course index. So when the test is trying to follow an &amp;quot;Activity name&amp;quot; link, it finds two different links:&lt;br /&gt;
* one in the course index&lt;br /&gt;
* another one in the course main content.&lt;br /&gt;
But the first one, the one in the course index, is hidden by the drawer, and the test fails.&lt;br /&gt;
&lt;br /&gt;
However the recommended behat steps&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
work &#039;&#039;&#039;fine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Some of the failing behats are fixed in https://github.com/ferranrecio/moodle/commit/c79d58a50b48aa6891ff1d3ba92a7b0ab2393c88#diff-fdf8b0b1eade3b69eaad038de0ddd7c8dec2be7afa32dc693fb929739a49fa9dR32 - MDL-71209&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 And I am on the &amp;quot;Test assignment name&amp;quot; &amp;quot;assign activity&amp;quot; page logged in as teacher1&lt;br /&gt;
instead of:&lt;br /&gt;
 When I log in as &amp;quot;teacher1&amp;quot;&lt;br /&gt;
 And I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 And I follow &amp;quot;Test assignment name&amp;quot;&lt;br /&gt;
== Core plugins review ==&lt;br /&gt;
A few plugins from core Moodle LMS which are no longer or hardly used have been removed and, if appropriate, added to the Moodle plugins directory.&lt;br /&gt;
&lt;br /&gt;
More information about this project, the list of plugins to be removed and the process to follow for keeping them before upgrading to 4.0 can be found in the [[Core plugins review]] page.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61229</id>
		<title>Moodle 4.0 developer update</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_4.0_developer_update&amp;diff=61229"/>
		<updated>2021-09-07T13:45:16Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* UX and theme changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 4.0}}This page will highlight the important changes that are coming in Moodle 4.0 for developers. Including how the UX improvements impact custom themes, relevant API changes, and what you can do as developer to prepare for the 4.0 release.&lt;br /&gt;
== UX and theme changes ==&lt;br /&gt;
The 4.0 theme changes can be classified as changes to improve navigation, changes for the course creation project and general UI improvements for Moodle 4.0 and newer only.&lt;br /&gt;
&lt;br /&gt;
==== Navigation project changes ====&lt;br /&gt;
A new layout has been added that pushes the blocks region offscreen called the drawers layout. This layout has a fixed width of 800px for the main content area and page buttons to open / close the drawers. Files:&lt;br /&gt;
 /theme/boost/layouts/drawers.php&lt;br /&gt;
 /theme/boost/templates/drawers.mustache&lt;br /&gt;
In case a page uses “fake blocks” the drawer region will be opened automatically on first visit.&lt;br /&gt;
&lt;br /&gt;
Child themes implementing this layout should update the theme config.php and configure the ‘drawers’ layout from theme boost for pages like ‘course’ and ‘incourse’&lt;br /&gt;
&lt;br /&gt;
Pages that should not use the drawers layout are the admin pages or other pages that require more horizontal space in the main content area.&lt;br /&gt;
&lt;br /&gt;
===== Primary / secondary navigation =====&lt;br /&gt;
The top navbar now includes the new &#039;&#039;&#039;primary navigation&#039;&#039;&#039;, this navigation used to be in the page navdrawer region. If custommenu items are configured in the global theme settings they will be added to the primary navigation.&lt;br /&gt;
&lt;br /&gt;
The main content area shows tabs for secondary navigation with a maximum of 5 items being rendered in this ‘more’ menu. A new UI component has been created to render menus like this. Files:&lt;br /&gt;
 /lib/templates/moremenu.mustache&lt;br /&gt;
&lt;br /&gt;
===== Navigation project Upcoming changes =====&lt;br /&gt;
&lt;br /&gt;
====== Edit switch. ======&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71610 MDL-71610]&lt;br /&gt;
&lt;br /&gt;
On theme boost the “Turn editing on” and  “Customise this page” buttons have been replaced by an edit switch in the top navbar. Theme Classic will keep using the old buttons. Child themes can choose to use the edit switch if the theme config.php is using this variable&lt;br /&gt;
 $THEME-&amp;gt;haseditswitch = true;&lt;br /&gt;
&lt;br /&gt;
==== Create a course project changes ====&lt;br /&gt;
The new course index feature can be themed using a set of scss variables. Use them to change the look and feel instead of adding custom css&lt;br /&gt;
 /theme/boost/scss/moodle/courseindex.scss&lt;br /&gt;
&lt;br /&gt;
===== Create a course project upcoming changes =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71691 MDL-71691]&lt;br /&gt;
&lt;br /&gt;
The activities in a course are rendered using a new activity UI component. The activities will use a new renderable and can be customised using a single mustache template&lt;br /&gt;
&lt;br /&gt;
The icons used for activities have been redesigned and use a monochrome svg icon. If contrib plugins provide an icon-mono.svg in their pix folder this icon will be rendered. For example :&lt;br /&gt;
 mod/quiz/pix/icon-mono.svg&lt;br /&gt;
The background colour for this icon can be styled using css in a plugin styles.css. Please use one of the theme variables for your icon background using:&lt;br /&gt;
 .modtype_myplugin .inlineiconsvg {&lt;br /&gt;
     background-color: var(--activitytypea);&lt;br /&gt;
 }&lt;br /&gt;
To customize all icon colours use this scss array and add it to the  ‘Raw initial SCSS’ in the theme Boost advanced settings page&lt;br /&gt;
&lt;br /&gt;
The complete array can be overridden using the ‘Raw initial SCSS’ in the theme settings page&lt;br /&gt;
 $activity-icon-colors: (&lt;br /&gt;
     &amp;quot;typea&amp;quot;: #5D63F6,&lt;br /&gt;
     &amp;quot;typeb&amp;quot;: #11A676,&lt;br /&gt;
     &amp;quot;typec&amp;quot;: #EB66A2,&lt;br /&gt;
     &amp;quot;typed&amp;quot;: #F7634D,&lt;br /&gt;
     &amp;quot;typee&amp;quot;: #399BE2,&lt;br /&gt;
     &amp;quot;typef&amp;quot;: #A378FF&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
==== General UI improvements upcoming changes ====&lt;br /&gt;
&lt;br /&gt;
===== Login page =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69371 MDL-69371]&lt;br /&gt;
&lt;br /&gt;
The login page has been redesigned and allows the admin to configure a background image for the login page only in the theme settings page. This change is available in both Boost and Classic. The login page still has all the features with an improved layout. &lt;br /&gt;
&lt;br /&gt;
===== The page footer =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-71965 MDL-71965]&lt;br /&gt;
&lt;br /&gt;
The page footer button is only visible when clicking a help button at the bottom right of the screen &lt;br /&gt;
&lt;br /&gt;
===== User initials as profile picture placeholder =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72305 MDL-72305]&lt;br /&gt;
&lt;br /&gt;
If users do not upload a profile picture the user initials are displayed on a rounded gray background as a placeholder picture in the top navbar or any other page using a placeholder image. This change will be available in both Boost and Classic.&lt;br /&gt;
&lt;br /&gt;
===== Image editable component, single image formfield =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-69880 MDL-69880]&lt;br /&gt;
&lt;br /&gt;
When uploading a user image or course image the user can now &#039;&#039;&#039;resize&#039;&#039;&#039; and &#039;&#039;&#039;crop&#039;&#039;&#039; the image. This feature can be reused for any component handling images using a new formfield:&lt;br /&gt;
 $mform-&amp;gt;addElement(&#039;singleimage&#039;).&lt;br /&gt;
This form-field will store a drawer file in the user context. On submitting the form the uploaded file needs to be stored in a more permanent location. The best way of achieving this is creating an image handler class to store / delete / handle form data. For example:&lt;br /&gt;
 course/classes/imageeditable/handler.php&lt;br /&gt;
The image editable component can be used as a standalone feature too using&lt;br /&gt;
 lib/classes/output/image_editable.php&lt;br /&gt;
When used as a standalone component it will allow users to change the profile picture from the user profile page, or update any other image used in a custom plugin or theme.&lt;br /&gt;
&lt;br /&gt;
===== Removal of back to top link =====&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-72454 MDL-72454]&lt;br /&gt;
&lt;br /&gt;
The back to top link will be removed for theme boost to make place for the page footer button. &lt;br /&gt;
&lt;br /&gt;
===== Theme Boost styling changes =====&lt;br /&gt;
By default rounded edges will be used for UI components [https://tracker.moodle.org/browse/MDL-72455 MDL-72455], for the page header and main content area the borders will be removed [https://tracker.moodle.org/browse/MDL-72457 MDL-72457]. &lt;br /&gt;
&lt;br /&gt;
== Component library ==&lt;br /&gt;
== Navigation ==&lt;br /&gt;
The core Navigation API has been left mostly untouched. The callbacks to all navigation callbacks remains unchanged and will be called as part of the regular &#039;navigation&#039; and &#039;settingsnav&#039; initialisation. Some new core classes have been created and exist within a new namespace &#039;core/navigation&#039; and serves as conduit to rearrange, cherry-pick existing navigation nodes from the navigation/settingsnav trees and display within the respective navigation type. As such, it is highly recommended to provide unique keys for custom navigation nodes as this helps in the cherry-picking / rearranging process within the new classes.&lt;br /&gt;
===== Primary navigation / Primary Output =====&lt;br /&gt;
The primary navigation(the navbar) apart from the existing content will now display links to the Dashboard, My Courses, Site Admin and Course search, by default. You can still add items to the navbar via the &#039;custom menu&#039; option. This will be displayed within the &#039;More&#039; menu. We have transitioned the menus to be rendered via templates - refer user_menu.mustache. The lang menu has been moved to reside within the user menu.&lt;br /&gt;
===== New view =====&lt;br /&gt;
All settings for courses/modules will now be displayed as tabs within the module. A predefined set of tabs will be shown with any remaining / newly added ones residing within the &#039;Course Admin&#039; page. The settings cog will not be shown anymore. It is recommended to review any settings as some might be displayed as tabs and possibly move them to the tertiary navigation as is done in the core activity modules&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;. At most 5 tabs will be displayed to a user with all the overflow nodes now residing within the &#039;More&#039; menu. Some of the nodes can be hidden by using the new functions defined. &lt;br /&gt;
===== New API functions =====&lt;br /&gt;
====== Page API ======&lt;br /&gt;
* Magic getters to fetch the primary and secondary navs and the primary output.&lt;br /&gt;
* The secondarynav magic getter also checks whether a custom secondary class has been defined within the module&#039;s local\views directory. Use this if you want to deviate from the standard secondary nav structure/order.&lt;br /&gt;
&lt;br /&gt;
* set_secondary_nav - Force override the secondary navigation class&lt;br /&gt;
&lt;br /&gt;
* has_secondary_navigation_setter - Sets the ‘_hassecondarynavigation’ to indicate whether a page should render the secondary navigation&lt;br /&gt;
====== Navigationlib ======&lt;br /&gt;
* set_show_in_secondary_navigation - whether or not a node should be displayed in the secondary nav. Accepts a single boolean argument&lt;br /&gt;
* set_force_into_more_menu- whether or not to force a node into the &#039;More&#039; menu. Accepts a single boolean argument&lt;br /&gt;
===== Changing order of tabs in secondary navigation nodes =====&lt;br /&gt;
Apart from the previously mentioned functions, you can also create a custom secondary class as mentioned earlier. This will automatically be picked by getter and used to render the secondary nav within the activity. E.g. mod_assign/local/views/secondary. Note: This is currently only possible on an activity and block level. &lt;br /&gt;
===== Upcoming changes: =====&lt;br /&gt;
# &amp;lt;sup&amp;gt;1 -&amp;lt;/sup&amp;gt; Complete tertiary nav overhaul for core’s modules - [https://tracker.moodle.org/browse/MDL-71912 MDL-71912]. [https://tracker.moodle.org/browse/MDL-71913 MDL-71913],[https://tracker.moodle.org/browse/MDL-71914 MDL-71914],[https://tracker.moodle.org/browse/MDL-71915 MDL-71915]&lt;br /&gt;
# Backwards compatibility for complex deep nested custom navigation. Any custom navigation added by 3rd party devs will now be displayed as flatter structure within a URL select - [https://tracker.moodle.org/browse/MDL-72352 MDL-72352]&lt;br /&gt;
# New module API to inject common content at the top of a module page. The common content would be the title, description and activity information. This solves 2 issues:&lt;br /&gt;
## A centralised location where we can handle #2 and inject it into the relevant page&lt;br /&gt;
## A centralised location where we can inject items particularly activity_information without the need to be replicated in each module. &lt;br /&gt;
== The core_courseformat subsystem ==&lt;br /&gt;
Most of the logic for rendering and editing a course has been moved to a new subsystem called courseformat. The subsystem is located in &amp;quot;course/format&amp;quot; folder so it includes all the format plugins inside. The methods and modules which are distributed between the course and the course/format folders are now rearranged or refactored to be aligned with the current Moodle coding style.&lt;br /&gt;
==== Mandatory renderer in course formats ====&lt;br /&gt;
Now format plugins renderer is not optional anymore. Legacy formats without a renderer will get a deprecation message but it will continue working however, they should create a new renderer as soon as possible. The section-based format can do it by extending the provided core_courseformat\output\section_renderer class which includes all the necessary methods.&lt;br /&gt;
==== New format base class ====&lt;br /&gt;
The old base_format class (which all plugins extend) is now renamed as core_courseformat\base. The new class provides all the functionally of the previous base_format but it has been refactored to be used as a centralized source of truth for the course rendering. Legacy formats should extend the new class to avoid the deprecation message.&lt;br /&gt;
&lt;br /&gt;
Now, the plugin format class provides information such as:&lt;br /&gt;
* If the page is displaying a single or multiple section&lt;br /&gt;
* Give access to other related format objects like the modinfo, the course record, maximum number of sections...&lt;br /&gt;
* If the format is compatible with features like course index, reactive components, ajax...&lt;br /&gt;
* Other format specifics like the page title, the default section name, default blocks...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The format instance is now the main object output components will use to render a course (see next section for more information).&lt;br /&gt;
==== New course output classes and mustache files ====&lt;br /&gt;
Traditionally, section-based course formats uses print_single_section_page and print_multiple_section_page to render the course content. In Moodle 4.0 most of the course rendering methods are migrated to output components and mustache templates. The old methods will get deprecation messages if they use the old renderer methods.&lt;br /&gt;
&lt;br /&gt;
This is an example of a format rendering a course:&amp;lt;syntaxhighlight lang=&amp;quot;php-brief&amp;quot;&amp;gt;&lt;br /&gt;
// Get the course format instance.&lt;br /&gt;
$format = course_get_format($course);&lt;br /&gt;
&lt;br /&gt;
// Get the specific format renderer.&lt;br /&gt;
$renderer = $format-&amp;gt;get_renderer($PAGE);&lt;br /&gt;
&lt;br /&gt;
if (!empty($displaysection)) {&lt;br /&gt;
    // Setup the format instance to display a single section.&lt;br /&gt;
    $format-&amp;gt;set_section_number($displaysection);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Create the ouptut instance and render it.&lt;br /&gt;
$outputclass = $format-&amp;gt;get_output_classname(&#039;content&#039;);&lt;br /&gt;
$widget = new $outputclass($format);&lt;br /&gt;
&lt;br /&gt;
echo $renderer-&amp;gt;render($widget);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Format plugins are free to use its own output classes to render a course, or they could override the existing output classes by providing their own implementation. For example, the default output for &amp;quot;content&amp;quot; (as in the previous example) is &amp;quot;core_courseformat\output\local\|content&amp;quot;, however, if the plugin has a &amp;quot;format_XXX\output\courseformat\content&amp;quot; class, the $format-&amp;gt;class the get_output_class will return the overridden one.&lt;br /&gt;
Another important update on course rendering is that now all course structure is rendered using mustache templates instead of the original html_writer methods. Now themes are able to override the course format by providing alternative versions of the mustache files. All core course templates are located in &amp;quot;course/format/templates&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
All the new output classes and a guide on how to migrate the current third-party plugins will be available soon.&lt;br /&gt;
==== Course editor javascript modules and frontend components ====&lt;br /&gt;
The majority of the javascript logic related to the course editing is replaced by AMD modules. Because this is a major change in the way courses are edited and rendered, by default format plugins will continue using the previous YUI modules for now. However, formats can start using the new libraries overriding the &amp;quot;$format-&amp;gt;supports_components()&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Some Moodle 4.0 new features are only available for courses using the new editor library:&lt;br /&gt;
* Edit the course via the course index&lt;br /&gt;
* Creating sections without reloading the course page&lt;br /&gt;
* The new move section/activity modal&lt;br /&gt;
* Native browser drag&amp;amp;drop implementation&lt;br /&gt;
The new course editor uses a component-based reactive pattern to keep track of the course changes. The pattern highlights are:&lt;br /&gt;
* The main AMD module &amp;quot;core_crouseformat\courseeditor&amp;quot; maintains a data structure called state.&lt;br /&gt;
* Each UI element is implemented as a Component that observes the course state data and reacts to any data change&lt;br /&gt;
* When any reactive component needs to modify the course, it asks the course editor to execute a mutation. Mutations encapsulate all web services calls and alter the course state data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reactive library documentation, as well as the format plugin migration guide, will be available soon.&lt;br /&gt;
==== Other course related 4.0 changes ====&lt;br /&gt;
Two new web services have been added:&lt;br /&gt;
* core_courseformat_get_state: user by the new javascript course editor to get the current course state data (containing the list of sections, activities, and other course-related data)&lt;br /&gt;
* core_courseformat_update_course: to alter the current course content. Each call returns the parts of the course state altered by the action&lt;br /&gt;
== API changes ==&lt;br /&gt;
== Behat changes ==&lt;br /&gt;
To make behat tests more readable and easy to maintain, it is recommended to use the most direct steps to get what the test needs. So since MDL-66335 was integrated, and the step was improved in MDL-72179 is highly recommended to use&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
instead of navigating to the activity via&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
Now that [https://docs.moodle.org/dev/Prototypes#Course_creation_improvements Course index] (MDL-71209) is integrated but the project is not stable, these behat steps&lt;br /&gt;
 I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 I follow &amp;quot;Activity name&amp;quot;&lt;br /&gt;
will fail using Boost theme.&lt;br /&gt;
&lt;br /&gt;
The reason for it is that the drawer used in Boost is hiding the course index. So when the test is trying to follow an &amp;quot;Activity name&amp;quot; link, it finds two different links:&lt;br /&gt;
* one in the course index&lt;br /&gt;
* another one in the course main content.&lt;br /&gt;
But the first one, the one in the course index, is hidden by the drawer, and the test fails.&lt;br /&gt;
&lt;br /&gt;
However the recommended behat steps&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page &lt;br /&gt;
or&lt;br /&gt;
 I am on the &amp;quot;Activity name&amp;quot; &amp;quot;[modname] activity&amp;quot; page logged in as &amp;quot;user&amp;quot;&lt;br /&gt;
work &#039;&#039;&#039;fine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Some of the failing behats are fixed in https://github.com/ferranrecio/moodle/commit/c79d58a50b48aa6891ff1d3ba92a7b0ab2393c88#diff-fdf8b0b1eade3b69eaad038de0ddd7c8dec2be7afa32dc693fb929739a49fa9dR32 - MDL-71209&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 And I am on the &amp;quot;Test assignment name&amp;quot; &amp;quot;assign activity&amp;quot; page logged in as teacher1&lt;br /&gt;
instead of:&lt;br /&gt;
 When I log in as &amp;quot;teacher1&amp;quot;&lt;br /&gt;
 And I am on &amp;quot;Course&amp;quot; course homepage&lt;br /&gt;
 And I follow &amp;quot;Test assignment name&amp;quot;&lt;br /&gt;
== Core plugins review ==&lt;br /&gt;
A few plugins from core Moodle LMS which are no longer or hardly used have been removed and, if appropriate, added to the Moodle plugins directory.&lt;br /&gt;
&lt;br /&gt;
More information about this project, the list of plugins to be removed and the process to follow for keeping them before upgrading to 4.0 can be found in the [[Core plugins review]] page.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55766</id>
		<title>Creating a theme based on classic</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55766"/>
		<updated>2019-03-21T07:05:15Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Theme specific files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.7}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
This is a tutorial for how to create a new theme based on the Classic theme.&lt;br /&gt;
&lt;br /&gt;
Moodle 3.7 includes a new core theme named &amp;quot;Classic&amp;quot; which is a starting point for themers wanting to build Moodle theme using a 3 column layout without the Boost navdrawer and settings menus.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
What is a theme? A theme in Moodle is just another type of plugin that can be developed. Themes are responsible for setting up the structure of each page and have the ability to customise the output of any page in Moodle.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on the tutorial https://docs.moodle.org/dev/Creating_a_theme_based_on_boost. You can download it or view the source code for it here: https://github.com/bmbrands/moodle-theme_picture&lt;br /&gt;
&lt;br /&gt;
=== Choosing a name ===&lt;br /&gt;
Your new theme will need a name. Try and think of something short and memorable - and make sure it is not a name that has already been used by someone else. A quick search on the [https://moodle.org/plugins moodle.org/plugins] can save you a lot of work renaming things later.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s call our new example theme &amp;quot;picture&amp;quot; as we will add some settings to allow &amp;quot;pictures&amp;quot; in various places in Moodle.&lt;br /&gt;
&lt;br /&gt;
=== Starting files ===&lt;br /&gt;
As a plugin, themes must start with the basic structure of a plugin in Moodle. See https://docs.moodle.org/dev/Tutorial#The_skeleton_of_your_plugin for an overview of the files common to all plugins in Moodle.&lt;br /&gt;
&lt;br /&gt;
Following this guide you can start creating your own theme. First, we create the folder for the new theme under under &amp;quot;/theme/&amp;quot; folder in the Moodle root directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
/theme/picture/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to add some standard plugin files to our theme. First is version.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/version.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// This is the version of the plugin.&lt;br /&gt;
$plugin-&amp;gt;version = 2019030400;&lt;br /&gt;
&lt;br /&gt;
// This is the version of Moodle this plugin requires.&lt;br /&gt;
$plugin-&amp;gt;requires = 2018051700;&lt;br /&gt;
&lt;br /&gt;
// This is the component name of the plugin - it always starts with &#039;theme_&#039;&lt;br /&gt;
// for themes and should be the same as the name of the folder.&lt;br /&gt;
$plugin-&amp;gt;component = &#039;theme_picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is a list of plugins, this plugin depends on (and their versions).&lt;br /&gt;
$plugin-&amp;gt;dependencies = [&lt;br /&gt;
    &#039;theme_classic&#039; =&amp;gt; 2018120700&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
// This is a stable release.&lt;br /&gt;
$plugin-&amp;gt;maturity = MATURITY_STABLE;&lt;br /&gt;
&lt;br /&gt;
// This is the named version.&lt;br /&gt;
$plugin-&amp;gt;release = 1.0;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need a language file so that all our strings can be translated into different languages. The name of this file is the component name of our plugin and it sits in the lang/en/ folder for our plugin. We can include translations of our plugin, but we can also provide translations via the https://lang.moodle.org/ website once our plugin has been published to the plugins database at http://www.moodle.org/plugins/.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/lang/en/theme_picture.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// A description shown in the admin theme selector.&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Theme picture is a child theme of the Classic. It adds the ability to upload background photos.&#039;;&lt;br /&gt;
// The name of our plugin.&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Picture&#039;;&lt;br /&gt;
// We need to include a lang string for each block region.&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Theme specific files ===&lt;br /&gt;
Theme plugins have a few more standard files they need to define.&lt;br /&gt;
&lt;br /&gt;
Themes require a favicon file to show in the address bar. See [[http://docs.moodle.org/en/Favicon Favicon]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/favicon.ico&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes also require an example screenshot to be displayed in the theme selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/screenshot.jpg&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes require a lib.php file. This file contains callbacks used by various API&#039;s in Moodle. Initially this file can be empty, but as we add features to our theme we will need to add some functions here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// We will add callbacks here as we add features to our theme.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Theme config goes in a config.php file. This is one of the most important files in our theme. Once we add this file we will be ready to test our theme for the first time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of Moodle - http://moodle.org/&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Picture config.&lt;br /&gt;
 *&lt;br /&gt;
 * @package   theme_picture&lt;br /&gt;
 * @copyright 2016 Damyon Wiese&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// $THEME is defined before this page is included and we can define settings by adding properties to this global object.&lt;br /&gt;
&lt;br /&gt;
// The first setting we need is the name of the theme. This should be the last part of the component name, and the same&lt;br /&gt;
// as the directory name for our theme.&lt;br /&gt;
$THEME-&amp;gt;name = &#039;picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This setting list the style sheets we want to include in our theme. Because we want to use SCSS instead of CSS - we won&#039;t&lt;br /&gt;
// list any style sheets. If we did we would list the name of a file in the /styles/ folder for our theme without any css file&lt;br /&gt;
// extensions.&lt;br /&gt;
$THEME-&amp;gt;sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a setting that can be used to provide some styling to the content in the TinyMCE text editor. This is no longer the&lt;br /&gt;
// default text editor and &amp;quot;Atto&amp;quot; does not need this setting so we won&#039;t provide anything. If we did it would work the same&lt;br /&gt;
// as the previous setting - listing a file in the /styles/ folder.&lt;br /&gt;
$THEME-&amp;gt;editor_sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a critical setting. We want to inherit from theme_classic because it provides a great starting point for SCSS bootstrap4&lt;br /&gt;
// themes. We have added add more than one parent here to inherit from multiple parents, and if we did they would be processed in&lt;br /&gt;
// order of importance (later themes overriding earlier ones). Things we will inherit from the parent theme include&lt;br /&gt;
// styles and mustache templates and some (not all) settings.&lt;br /&gt;
$THEME-&amp;gt;parents = [&#039;boost&#039;, &#039;classic&#039;];&lt;br /&gt;
&lt;br /&gt;
// A dock is a way to take blocks out of the page and put them in a persistent floating area on the side of the page.&lt;br /&gt;
// does not support a dock so we won&#039;t either - but look at bootstrapbase for an example of a theme with a dock.&lt;br /&gt;
$THEME-&amp;gt;enable_dock = false;&lt;br /&gt;
&lt;br /&gt;
// This is an old setting used to load specific CSS for some YUI JS. We don&#039;t need it in Classic based themes because Classic&lt;br /&gt;
// provides default styling for the YUI modules that we use. It is not recommended to use this setting anymore.&lt;br /&gt;
$THEME-&amp;gt;yuicssmodules = array();&lt;br /&gt;
&lt;br /&gt;
// Most themes will use this rendererfactory as this is the one that allows the theme to override any other renderer.&lt;br /&gt;
$THEME-&amp;gt;rendererfactory = &#039;theme_overridden_renderer_factory&#039;;&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_picture_get_pre_scss&#039;;&lt;br /&gt;
&lt;br /&gt;
// Since we are using 2 parent themes the correct location of the layout files needs to be defined. For this theme we need the multiple&lt;br /&gt;
// column layouts.&lt;br /&gt;
$THEME-&amp;gt;layouts = [&lt;br /&gt;
    // Most backwards compatible layout without the blocks - this is the layout used by default.&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Standard layout with blocks, this is recommended for most pages with general information.&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Main course page.&lt;br /&gt;
    &#039;course&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;coursecategory&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Part of course, typical for modules - default page layout if $cm specified in require_login().&lt;br /&gt;
    &#039;incourse&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The site home page.&lt;br /&gt;
    &#039;frontpage&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofullheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Server administration scripts.&lt;br /&gt;
    &#039;admin&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // My dashboard page.&lt;br /&gt;
    &#039;mydashboard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nonavbar&#039; =&amp;gt; true, &#039;langmenu&#039; =&amp;gt; true, &#039;nocontextheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // My public page.&lt;br /&gt;
    &#039;mypublic&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;login&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;boost&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;login.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    // Pages that appear in pop-up windows - no navigation, no blocks, no header.&lt;br /&gt;
    &#039;popup&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // No blocks and minimal footer - used for legacy frame layouts only!&lt;br /&gt;
    &#039;frametop&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nocoursefooter&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible.&lt;br /&gt;
    &#039;embedded&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array()&lt;br /&gt;
    ),&lt;br /&gt;
    // Used during upgrade and install, and for the &#039;This site is undergoing maintenance&#039; message.&lt;br /&gt;
    // This must not have any blocks, links, or API calls that would lead to database or cache interaction.&lt;br /&gt;
    // Please be extremely careful if you are modifying this layout.&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;boost&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;maintenance.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Should display the content and basic headers only.&lt;br /&gt;
    &#039;print&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; false),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used when a redirection is occuring.&lt;br /&gt;
    &#039;redirect&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;boost&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for reports.&lt;br /&gt;
    &#039;report&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for safebrowser and securewindow.&lt;br /&gt;
    &#039;secure&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;secure.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;&lt;br /&gt;
    )&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ready set go! ===&lt;br /&gt;
If you have been following along - now we are at the point where we can actually install and test our new theme. Try it now by visiting the admin notifications page to install the new plugin, and then choosing the new theme from the theme selector.&lt;br /&gt;
&lt;br /&gt;
[[https://docs.moodle.org/en/Standard_themes#Theme_selector Theme selector]]&lt;br /&gt;
&lt;br /&gt;
When you choose the new theme - you will find that it looks exactly the same as Classic. At this point with our minimal configuration - we are inheriting almost everything from our parent theme including styles and templates. You will notice though that we don&#039;t inherit the settings from our parent theme.&lt;br /&gt;
&lt;br /&gt;
=== Setup your Sass files ===&lt;br /&gt;
Once you have a theme that has been installed into your Moodle setup it is time to start styling it. The core Boostrap scss is very well suited for customization using Sass variables and overriding component. On [https://getbootstrap.com/docs/4.3/getting-started/theming/#variable-defaults Get bootstrap.com] there is some documentation on Sass variables and in theme/boost/scss/boostrap/_variables.scss you will see the full list of variables that can be changed.&lt;br /&gt;
&lt;br /&gt;
Before we start the theme needs to be able to return the complete set of Sass files that are required for Moodle and our custom Sass. So as a start we will be editing the config again:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/config.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// This is the function that returns the SCSS source for the main file in our theme.&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_picture_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable $THEME-&amp;gt;scss is configured to be a callback function that when called returns all the Scss source files from our parent theme and the picture theme. Once the callback function is defined our Theme&#039;s lib.php needs to contain the callback function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string All fixed Sass for this theme.&lt;br /&gt;
 */&lt;br /&gt;
function theme_picture_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
    $fs = get_file_storage();&lt;br /&gt;
&lt;br /&gt;
    // Main CSS - Get the CSS from theme Classic.&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/classic/scss/classic/pre.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/classic/scss/preset/default.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/classic/scss/classic/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    // Pre CSS - this is loaded AFTER any prescss from the setting but before the main scss.&lt;br /&gt;
    $pre = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/picture/scss/pre.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    // Post CSS - this is loaded AFTER the main scss but before the extra scss from the setting.&lt;br /&gt;
    $post = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/picture/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    // Combine them together.&lt;br /&gt;
    return $pre . &amp;quot;\n&amp;quot; . $scss . &amp;quot;\n&amp;quot; . $post;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function theme_picture_get_main_scss_content uses the scss files from classic, the default.scss file from classic contains @import statements to include the files from theme Boost so we can be sure we have all the css we need.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/classic/scss/preset/default.scss&#039;&#039;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To complete the setup all we need to do is create the pre.scss and post.scss files that will contain our Sass variables and other Css. The pre.scss file is the file that needs to be loaded first before the files from theme classic are imported. It will contain the variable we configure for things like fonts, colours and spacing. The post.scss file will contain all other custom css.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/scss/pre.scss&#039;&#039;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// We need larger buttons.&lt;br /&gt;
$btn-padding-y:         0.5rem !default;&lt;br /&gt;
$btn-padding-x:         1.1rem !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/scss/post.scss&#039;&#039;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// We like our buttons very round.&lt;br /&gt;
.btn {&lt;br /&gt;
  border-radius: 1.078em;&lt;br /&gt;
  font-family: $font-family-sans-serif;&lt;br /&gt;
  font-size: 0.875em;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You might have noticed the &amp;quot;!default&amp;quot; statement after the variables in our pre.scss file. This means the variable is set if the variable has not been defined before. When inspecting the Bootstrap variables defined in theme/boost/scss/bootstrap/_variables.scss you will see all variable have a &amp;quot;!default&amp;quot; statement meaning we can change any variable!&lt;br /&gt;
&lt;br /&gt;
With the preset files in place we can select our theme from the available installed themes (If you did not do that already) and purge changes. You should be able to see the Classic 3 column layout and our round buttons.&lt;br /&gt;
&lt;br /&gt;
=== Adding custom settings to our theme ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&#039;s it for this tutorial, but there are [[:Category:Themes| more Themes docs]] to browse.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55649</id>
		<title>Creating a theme based on classic</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55649"/>
		<updated>2019-03-05T18:20:32Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.6}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
This is a tutorial for how to create a new theme based on the Classic theme.&lt;br /&gt;
&lt;br /&gt;
Moodle 3.7 includes a new core theme named &amp;quot;Classic&amp;quot; which is a starting point for themers wanting to build Moodle theme using a 3 column layout without the Boost navdrawer and settings menus.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
What is a theme? A theme in Moodle is just another type of plugin that can be developed. Themes are responsible for setting up the structure of each page and have the ability to customise the output of any page in Moodle.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on the tutorial https://docs.moodle.org/dev/Creating_a_theme_based_on_boost. You can download it or view the source code for it here: https://github.com/bmbrands/moodle-theme_picture&lt;br /&gt;
&lt;br /&gt;
=== Choosing a name ===&lt;br /&gt;
Your new theme will need a name. Try and think of something short and memorable - and make sure it is not a name that has already been used by someone else. A quick search on the moodle.org/plugins can save you a lot of work renaming things later.&lt;br /&gt;
&lt;br /&gt;
Let;s call our new example theme &amp;quot;picture&amp;quot; as we will add some settings to allow &amp;quot;pictures&amp;quot; in various places in Moodle.&lt;br /&gt;
&lt;br /&gt;
=== Starting files ===&lt;br /&gt;
As a plugin, themes must start with the basic structure of a plugin in Moodle. See https://docs.moodle.org/dev/Tutorial#The_skeleton_of_your_plugin for an overview of the files common to all plugins in Moodle.&lt;br /&gt;
&lt;br /&gt;
Following this guide you can start creating your own theme. First, we create the folder for the new theme under under &amp;quot;/theme/&amp;quot; folder in the Moodle root directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
/theme/picture/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to add some standard plugin files to our theme. First is version.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/version.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// This is the version of the plugin.&lt;br /&gt;
$plugin-&amp;gt;version = 2019030400;&lt;br /&gt;
&lt;br /&gt;
// This is the version of Moodle this plugin requires.&lt;br /&gt;
$plugin-&amp;gt;requires = 2018051700;&lt;br /&gt;
&lt;br /&gt;
// This is the component name of the plugin - it always starts with &#039;theme_&#039;&lt;br /&gt;
// for themes and should be the same as the name of the folder.&lt;br /&gt;
$plugin-&amp;gt;component = &#039;theme_picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is a list of plugins, this plugin depends on (and their versions).&lt;br /&gt;
$plugin-&amp;gt;dependencies = [&lt;br /&gt;
    &#039;theme_classic&#039; =&amp;gt; 2018120700&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
// This is a stable release.&lt;br /&gt;
$plugin-&amp;gt;maturity = MATURITY_STABLE;&lt;br /&gt;
&lt;br /&gt;
// This is the named version.&lt;br /&gt;
$plugin-&amp;gt;release = 1.0;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need a language file so that all our strings can be translated into different languages. The name of this file is the component name of our plugin and it sits in the lang/en/ folder for our plugin. We can include translations of our plugin, but we can also provide translations via the https://lang.moodle.org/ website once our plugin has been published to the plugins database at http://www.moodle.org/plugins/.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/lang/en/theme_picture.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// A description shown in the admin theme selector.&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Theme picture is a child theme of the Classic. It adds the ability to upload background photos.&#039;;&lt;br /&gt;
// The name of our plugin.&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Picture&#039;;&lt;br /&gt;
// We need to include a lang string for each block region.&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Theme specific files ===&lt;br /&gt;
Theme plugins have a few more standard files they need to define.&lt;br /&gt;
&lt;br /&gt;
Themes require a favicon file to show in the address bar. See [[http://docs.moodle.org/en/Favicon Favicon]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/favicon.ico&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes also require an example screenshot to be displayed in the theme selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/screenshot.jpg&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes require a lib.php file. This file contains callbacks used by various API&#039;s in Moodle. Initially this file can be empty, but as we add features to our theme we will need to add some functions here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// We will add callbacks here as we add features to our theme.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Theme config goes in a config.php file. This is one of the most important files in our theme. Once we add this file we will be ready to test our theme for the first time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of Moodle - http://moodle.org/&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Picture config.&lt;br /&gt;
 *&lt;br /&gt;
 * @package   theme_picture&lt;br /&gt;
 * @copyright 2016 Damyon Wiese&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// $THEME is defined before this page is included and we can define settings by adding properties to this global object.&lt;br /&gt;
&lt;br /&gt;
// The first setting we need is the name of the theme. This should be the last part of the component name, and the same&lt;br /&gt;
// as the directory name for our theme.&lt;br /&gt;
$THEME-&amp;gt;name = &#039;picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This setting list the style sheets we want to include in our theme. Because we want to use SCSS instead of CSS - we won&#039;t&lt;br /&gt;
// list any style sheets. If we did we would list the name of a file in the /styles/ folder for our theme without any css file&lt;br /&gt;
// extensions.&lt;br /&gt;
$THEME-&amp;gt;sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a setting that can be used to provide some styling to the content in the TinyMCE text editor. This is no longer the&lt;br /&gt;
// default text editor and &amp;quot;Atto&amp;quot; does not need this setting so we won&#039;t provide anything. If we did it would work the same&lt;br /&gt;
// as the previous setting - listing a file in the /styles/ folder.&lt;br /&gt;
$THEME-&amp;gt;editor_sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a critical setting. We want to inherit from theme_classic because it provides a great starting point for SCSS bootstrap4&lt;br /&gt;
// themes. We have added add more than one parent here to inherit from multiple parents, and if we did they would be processed in&lt;br /&gt;
// order of importance (later themes overriding earlier ones). Things we will inherit from the parent theme include&lt;br /&gt;
// styles and mustache templates and some (not all) settings.&lt;br /&gt;
$THEME-&amp;gt;parents = [&#039;boost&#039;, &#039;classic&#039;];&lt;br /&gt;
&lt;br /&gt;
// A dock is a way to take blocks out of the page and put them in a persistent floating area on the side of the page.&lt;br /&gt;
// does not support a dock so we won&#039;t either - but look at bootstrapbase for an example of a theme with a dock.&lt;br /&gt;
$THEME-&amp;gt;enable_dock = false;&lt;br /&gt;
&lt;br /&gt;
// This is an old setting used to load specific CSS for some YUI JS. We don&#039;t need it in Classic based themes because Classic&lt;br /&gt;
// provides default styling for the YUI modules that we use. It is not recommended to use this setting anymore.&lt;br /&gt;
$THEME-&amp;gt;yuicssmodules = array();&lt;br /&gt;
&lt;br /&gt;
// Most themes will use this rendererfactory as this is the one that allows the theme to override any other renderer.&lt;br /&gt;
$THEME-&amp;gt;rendererfactory = &#039;theme_overridden_renderer_factory&#039;;&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_picture_get_pre_scss&#039;;&lt;br /&gt;
&lt;br /&gt;
// Since we are using 2 parent themes the correct location of the layout files needs to be defined. For this theme we need the multiple&lt;br /&gt;
// column layouts.&lt;br /&gt;
$THEME-&amp;gt;layouts = [&lt;br /&gt;
    // Most backwards compatible layout without the blocks - this is the layout used by default.&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Standard layout with blocks, this is recommended for most pages with general information.&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Main course page.&lt;br /&gt;
    &#039;course&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;coursecategory&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Part of course, typical for modules - default page layout if $cm specified in require_login().&lt;br /&gt;
    &#039;incourse&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The site home page.&lt;br /&gt;
    &#039;frontpage&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofullheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Server administration scripts.&lt;br /&gt;
    &#039;admin&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // My dashboard page.&lt;br /&gt;
    &#039;mydashboard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nonavbar&#039; =&amp;gt; true, &#039;langmenu&#039; =&amp;gt; true, &#039;nocontextheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // My public page.&lt;br /&gt;
    &#039;mypublic&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;login&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;boost&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;login.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    // Pages that appear in pop-up windows - no navigation, no blocks, no header.&lt;br /&gt;
    &#039;popup&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // No blocks and minimal footer - used for legacy frame layouts only!&lt;br /&gt;
    &#039;frametop&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nocoursefooter&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible.&lt;br /&gt;
    &#039;embedded&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array()&lt;br /&gt;
    ),&lt;br /&gt;
    // Used during upgrade and install, and for the &#039;This site is undergoing maintenance&#039; message.&lt;br /&gt;
    // This must not have any blocks, links, or API calls that would lead to database or cache interaction.&lt;br /&gt;
    // Please be extremely careful if you are modifying this layout.&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;maintenance.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Should display the content and basic headers only.&lt;br /&gt;
    &#039;print&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; false),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used when a redirection is occuring.&lt;br /&gt;
    &#039;redirect&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for reports.&lt;br /&gt;
    &#039;report&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for safebrowser and securewindow.&lt;br /&gt;
    &#039;secure&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;secure.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;&lt;br /&gt;
    )&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ready set go! ===&lt;br /&gt;
If you have been following along - now we are at the point where we can actually install and test our new theme. Try it now by visiting the admin notifications page to install the new plugin, and then choosing the new theme from the theme selector.&lt;br /&gt;
&lt;br /&gt;
[[https://docs.moodle.org/en/Standard_themes#Theme_selector Theme selector]]&lt;br /&gt;
&lt;br /&gt;
When you choose the new theme - you will find that it looks exactly the same as Classic. At this point with our minimal configuration - we are inheriting almost everything from our parent theme including styles and templates. You will notice though that we don&#039;t inherit the settings from our parent theme.&lt;br /&gt;
&lt;br /&gt;
=== Setup your Sass files ===&lt;br /&gt;
Once you have a theme that has been installed into your Moodle setup it is time to start styling it. The core Boostrap scss is very well suited for customization using Sass variables and overriding component. On [https://getbootstrap.com/docs/4.3/getting-started/theming/#variable-defaults Get bootstrap.com] there is some documentation on Sass variables and in theme/boost/scss/boostrap/_variables.scss you will see the full list of variables that can be changed.&lt;br /&gt;
&lt;br /&gt;
Before we start the theme needs to be able to return the complete set of Sass files that are required for Moodle and our custom Sass. So as a start we will be editing the config again:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/config.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// This is the function that returns the SCSS source for the main file in our theme.&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_picture_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable $THEME-&amp;gt;scss is configured to be a callback function that when called returns all the Scss source files from our parent theme and the picture theme. Once the callback function is defined our Theme&#039;s lib.php needs to contain the callback function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string All fixed Sass for this theme.&lt;br /&gt;
 */&lt;br /&gt;
function theme_picture_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
    $fs = get_file_storage();&lt;br /&gt;
&lt;br /&gt;
    // Main CSS - Get the CSS from theme Classic.&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/classic/scss/classic/pre.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/classic/scss/preset/default.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/classic/scss/classic/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    // Pre CSS - this is loaded AFTER any prescss from the setting but before the main scss.&lt;br /&gt;
    $pre = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/picture/scss/pre.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    // Post CSS - this is loaded AFTER the main scss but before the extra scss from the setting.&lt;br /&gt;
    $post = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/picture/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    // Combine them together.&lt;br /&gt;
    return $pre . &amp;quot;\n&amp;quot; . $scss . &amp;quot;\n&amp;quot; . $post;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function theme_picture_get_main_scss_content uses the scss files from classic, the default.scss file from classic contains @import statements to include the files from theme Boost so we can be sure we have all the css we need.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/classic/scss/preset/default.scss&#039;&#039;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To complete the setup all we need to do is create the pre.scss and post.scss files that will contain our Sass variables and other Css. The pre.scss file is the file that needs to be loaded first before the files from theme classic are imported. It will contain the variable we configure for things like fonts, colours and spacing. The post.scss file will contain all other custom css.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/scss/pre.scss&#039;&#039;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// We need larger buttons.&lt;br /&gt;
$btn-padding-y:         0.5rem !default;&lt;br /&gt;
$btn-padding-x:         1.1rem !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/scss/post.scss&#039;&#039;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// We like our buttons very round.&lt;br /&gt;
.btn {&lt;br /&gt;
  border-radius: 1.078em;&lt;br /&gt;
  font-family: $font-family-sans-serif;&lt;br /&gt;
  font-size: 0.875em;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You might have noticed the &amp;quot;!default&amp;quot; statement after the variables in our pre.scss file. This means the variable is set if the variable has not been defined before. When inspecting the Bootstrap variables defined in theme/boost/scss/bootstrap/_variables.scss you will see all variable have a &amp;quot;!default&amp;quot; statement meaning we can change any variable!&lt;br /&gt;
&lt;br /&gt;
With the preset files in place we can select our theme from the avaible installed themes (If you did not do that already) and purge changes. You should be able to see the Classic 3 column layout and our round buttons.&lt;br /&gt;
&lt;br /&gt;
=== Adding custom settings to our theme ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&#039;s it for this tutorial, but there are [[:Category:Themes| more Themes docs]] to browse.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55648</id>
		<title>Creating a theme based on classic</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55648"/>
		<updated>2019-03-05T18:10:45Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Ready set go! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.6}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
This is a tutorial for how to create a new theme based on the Classic theme.&lt;br /&gt;
&lt;br /&gt;
Moodle 3.7 includes a new core theme named &amp;quot;Classic&amp;quot; which is a starting point for themers wanting to build Moodle theme using a 3 column layout without the Boost navdrawer and settings menus.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
What is a theme? A theme in Moodle is just another type of plugin that can be developed. Themes are responsible for setting up the structure of each page and have the ability to customise the output of any page in Moodle.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on a the tutorial https://docs.moodle.org/dev/Creating_a_theme_based_on_boost. You can download it or view the source code for it here: https://github.com/bmbrands/moodle-theme_picture&lt;br /&gt;
&lt;br /&gt;
=== Choosing a name ===&lt;br /&gt;
Your new theme will need a name. Try and think of something short and memorable - and make sure it is not a name that has already been used by someone else. A quick search on the moodle.org/plugins can save you a lot of work renaming things later.&lt;br /&gt;
&lt;br /&gt;
Lets call our new example theme &amp;quot;brands&amp;quot; as we will add some settings to allow &amp;quot;branding&amp;quot; in various places in Moodle.&lt;br /&gt;
&lt;br /&gt;
=== Starting files ===&lt;br /&gt;
As a plugin, themes must start with the basic structure of a plugin in Moodle. See https://docs.moodle.org/dev/Tutorial#The_skeleton_of_your_plugin for an overview of the files common to all plugins in Moodle.&lt;br /&gt;
&lt;br /&gt;
Following this guide we can start creating our theme. First we create the folder for the new theme under under &amp;quot;/theme/&amp;quot; folder in the Moodle root directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
/theme/picture/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to add some standard plugin files to our theme. First is version.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/version.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// This is the version of the plugin.&lt;br /&gt;
$plugin-&amp;gt;version = 2019030400;&lt;br /&gt;
&lt;br /&gt;
// This is the version of Moodle this plugin requires.&lt;br /&gt;
$plugin-&amp;gt;requires = 2018051700;&lt;br /&gt;
&lt;br /&gt;
// This is the component name of the plugin - it always starts with &#039;theme_&#039;&lt;br /&gt;
// for themes and should be the same as the name of the folder.&lt;br /&gt;
$plugin-&amp;gt;component = &#039;theme_picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is a list of plugins, this plugin depends on (and their versions).&lt;br /&gt;
$plugin-&amp;gt;dependencies = [&lt;br /&gt;
    &#039;theme_classic&#039; =&amp;gt; 2018120700&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
// This is a stable release.&lt;br /&gt;
$plugin-&amp;gt;maturity = MATURITY_STABLE;&lt;br /&gt;
&lt;br /&gt;
// This is the named version.&lt;br /&gt;
$plugin-&amp;gt;release = 1.0;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need a language file so that all our strings can be translated into different languages. The name of this file is the component name of our plugin and it sits in the lang/en/ folder for our plugin. We can include translations of our plugin, but we can also provide translations via the https://lang.moodle.org/ website once our plugin has been published to the plugins database at http://www.moodle.org/plugins/.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/lang/en/theme_picture.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// A description shown in the admin theme selector.&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Theme picture is a child theme of the Classic. It adds the ability to upload background photos.&#039;;&lt;br /&gt;
// The name of our plugin.&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Picture&#039;;&lt;br /&gt;
// We need to include a lang string for each block region.&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Theme specific files ===&lt;br /&gt;
Theme plugins have a few more standard files they need to define.&lt;br /&gt;
&lt;br /&gt;
Themes require a favicon file to show in the address bar. See [[http://docs.moodle.org/en/Favicon Favicon]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/favicon.ico&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes also require an example screenshot to be displayed in the theme selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/screenshot.jpg&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes require a lib.php file. This file contains callbacks used by various API&#039;s in Moodle. Initially this file can be empty, but as we add features to our theme we will need to add some functions here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// We will add callbacks here as we add features to our theme.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Theme config goes in a config.php file. This is one of the most important files in our theme. Once we add this file we will be ready to test our theme for the first time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of Moodle - http://moodle.org/&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Picture config.&lt;br /&gt;
 *&lt;br /&gt;
 * @package   theme_picture&lt;br /&gt;
 * @copyright 2016 Damyon Wiese&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// $THEME is defined before this page is included and we can define settings by adding properties to this global object.&lt;br /&gt;
&lt;br /&gt;
// The first setting we need is the name of the theme. This should be the last part of the component name, and the same&lt;br /&gt;
// as the directory name for our theme.&lt;br /&gt;
$THEME-&amp;gt;name = &#039;picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This setting list the style sheets we want to include in our theme. Because we want to use SCSS instead of CSS - we won&#039;t&lt;br /&gt;
// list any style sheets. If we did we would list the name of a file in the /styles/ folder for our theme without any css file&lt;br /&gt;
// extensions.&lt;br /&gt;
$THEME-&amp;gt;sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a setting that can be used to provide some styling to the content in the TinyMCE text editor. This is no longer the&lt;br /&gt;
// default text editor and &amp;quot;Atto&amp;quot; does not need this setting so we won&#039;t provide anything. If we did it would work the same&lt;br /&gt;
// as the previous setting - listing a file in the /styles/ folder.&lt;br /&gt;
$THEME-&amp;gt;editor_sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a critical setting. We want to inherit from theme_classic because it provides a great starting point for SCSS bootstrap4&lt;br /&gt;
// themes. We have added add more than one parent here to inherit from multiple parents, and if we did they would be processed in&lt;br /&gt;
// order of importance (later themes overriding earlier ones). Things we will inherit from the parent theme include&lt;br /&gt;
// styles and mustache templates and some (not all) settings.&lt;br /&gt;
$THEME-&amp;gt;parents = [&#039;boost&#039;, &#039;classic&#039;];&lt;br /&gt;
&lt;br /&gt;
// A dock is a way to take blocks out of the page and put them in a persistent floating area on the side of the page.&lt;br /&gt;
// does not support a dock so we won&#039;t either - but look at bootstrapbase for an example of a theme with a dock.&lt;br /&gt;
$THEME-&amp;gt;enable_dock = false;&lt;br /&gt;
&lt;br /&gt;
// This is an old setting used to load specific CSS for some YUI JS. We don&#039;t need it in Classic based themes because Classic&lt;br /&gt;
// provides default styling for the YUI modules that we use. It is not recommended to use this setting anymore.&lt;br /&gt;
$THEME-&amp;gt;yuicssmodules = array();&lt;br /&gt;
&lt;br /&gt;
// Most themes will use this rendererfactory as this is the one that allows the theme to override any other renderer.&lt;br /&gt;
$THEME-&amp;gt;rendererfactory = &#039;theme_overridden_renderer_factory&#039;;&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_picture_get_pre_scss&#039;;&lt;br /&gt;
&lt;br /&gt;
// Since we are using 2 parent themes the correct location of the layout files needs to be define. For this theme we need the multiple&lt;br /&gt;
// column layouts.&lt;br /&gt;
$THEME-&amp;gt;layouts = [&lt;br /&gt;
    // Most backwards compatible layout without the blocks - this is the layout used by default.&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Standard layout with blocks, this is recommended for most pages with general information.&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Main course page.&lt;br /&gt;
    &#039;course&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;coursecategory&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Part of course, typical for modules - default page layout if $cm specified in require_login().&lt;br /&gt;
    &#039;incourse&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The site home page.&lt;br /&gt;
    &#039;frontpage&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofullheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Server administration scripts.&lt;br /&gt;
    &#039;admin&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // My dashboard page.&lt;br /&gt;
    &#039;mydashboard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nonavbar&#039; =&amp;gt; true, &#039;langmenu&#039; =&amp;gt; true, &#039;nocontextheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // My public page.&lt;br /&gt;
    &#039;mypublic&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;login&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;boost&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;login.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    // Pages that appear in pop-up windows - no navigation, no blocks, no header.&lt;br /&gt;
    &#039;popup&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // No blocks and minimal footer - used for legacy frame layouts only!&lt;br /&gt;
    &#039;frametop&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nocoursefooter&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible.&lt;br /&gt;
    &#039;embedded&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array()&lt;br /&gt;
    ),&lt;br /&gt;
    // Used during upgrade and install, and for the &#039;This site is undergoing maintenance&#039; message.&lt;br /&gt;
    // This must not have any blocks, links, or API calls that would lead to database or cache interaction.&lt;br /&gt;
    // Please be extremely careful if you are modifying this layout.&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;maintenance.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Should display the content and basic headers only.&lt;br /&gt;
    &#039;print&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; false),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used when a redirection is occuring.&lt;br /&gt;
    &#039;redirect&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for reports.&lt;br /&gt;
    &#039;report&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for safebrowser and securewindow.&lt;br /&gt;
    &#039;secure&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;secure.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;&lt;br /&gt;
    )&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ready set go! ===&lt;br /&gt;
If you have been following along - now we are at the point where we can actually install and test our new theme. Try it now by visiting the admin notifications page to install the new plugin, and then choosing the new theme from the theme selector.&lt;br /&gt;
&lt;br /&gt;
[[https://docs.moodle.org/en/Standard_themes#Theme_selector Theme selector]]&lt;br /&gt;
&lt;br /&gt;
When you choose the new theme - you will find that it looks exactly the same as Classic. At this point with our minimal configuration - we are inheriting almost everything from our parent theme including styles and templates. You will notice though that we don&#039;t inherit the settings from our parent theme.&lt;br /&gt;
&lt;br /&gt;
=== Setup your Sass files ===&lt;br /&gt;
Once you have a theme that has been installed into your Moodle setup it is time to start styling it. The core Boostrap is very well suited for customization using Sass variables and overriding componentent. On [https://getbootstrap.com/docs/4.3/getting-started/theming/#variable-defaults Get bootstrap.com] there is some documentation on Sass variables and in theme/boost/scss/boostrap/_variables.scss you will see the full list of variables that can be changed.&lt;br /&gt;
&lt;br /&gt;
Before we start the theme needs to be able to return the complete set of Sass files that are required for Moodle and our custom Sass. So as a start we will be editing the config again:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/config.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// This is the function that returns the SCSS source for the main file in our theme.&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_picture_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable $THEME-&amp;gt;scss is configured to be a callback function that when called returnes all the Scss source files from our parent theme and the picture theme. Once the callback function is defined our Theme&#039;s lib.php needs to contain the callback function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
	/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string All fixed Sass for this theme.&lt;br /&gt;
 */&lt;br /&gt;
function theme_picture_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
    $fs = get_file_storage();&lt;br /&gt;
&lt;br /&gt;
    // Main CSS - Get the CSS from theme Classic.&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/classic/scss/classic/pre.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/classic/scss/preset/default.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/classic/scss/classic/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    // Pre CSS - this is loaded AFTER any prescss from the setting but before the main scss.&lt;br /&gt;
    $pre = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/picture/scss/pre.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    // Post CSS - this is loaded AFTER the main scss but before the extra scss from the setting.&lt;br /&gt;
    $post = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/picture/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    // Combine them together.&lt;br /&gt;
    return $pre . &amp;quot;\n&amp;quot; . $scss . &amp;quot;\n&amp;quot; . $post;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function theme_picture_get_main_scss_content uses the scss files from classic, the default.scss file from classic contains @import statements to include the files from theme Boost so we can be sure we have all the css we need.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/classic/scss/preset/default.scss&#039;&#039;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To complete the setup all we need to do is create the pre.scss and post.scss files that will contain our Sass variables and other Css. The pre.scss file is the file that needs to be loaded first before the files from theme classic are imported. It will contain the variable we configure for things like fonts, colours and spacing. The post.scss file will contain all other custom css and overrided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/scss/pre.scss&#039;&#039;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// We need larger buttons.&lt;br /&gt;
$btn-padding-y:         0.5rem !default;&lt;br /&gt;
$btn-padding-x:         1.1rem !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/picture/scss/post.scss&#039;&#039;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// We like our buttons very round.&lt;br /&gt;
.btn {&lt;br /&gt;
  border-radius: 1.078em;&lt;br /&gt;
  font-family: $font-family-sans-serif;&lt;br /&gt;
  font-size: 0.875em;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You might have noticed the &amp;quot;!default&amp;quot; statement after the variables in our pre.scss file. This means the variable is set if the variable has not been defined before. When inspecting the Bootstrap variables defined in theme/boost/scss/bootstrap/_variables.scss you will see all variable have a &amp;quot;!default&amp;quot; statement meaning we can change any variable!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thats it for this tutorial, but there are [[:Category:Themes| more Themes docs]] to browse.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55647</id>
		<title>Creating a theme based on classic</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55647"/>
		<updated>2019-03-05T15:51:27Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Theme specific files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.6}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
This is a tutorial for how to create a new theme based on the Classic theme.&lt;br /&gt;
&lt;br /&gt;
Moodle 3.7 includes a new core theme named &amp;quot;Classic&amp;quot; which is a starting point for themers wanting to build Moodle theme using a 3 column layout without the Boost navdrawer and settings menus.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
What is a theme? A theme in Moodle is just another type of plugin that can be developed. Themes are responsible for setting up the structure of each page and have the ability to customise the output of any page in Moodle.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on a the tutorial https://docs.moodle.org/dev/Creating_a_theme_based_on_boost. You can download it or view the source code for it here: https://github.com/bmbrands/moodle-theme_picture&lt;br /&gt;
&lt;br /&gt;
=== Choosing a name ===&lt;br /&gt;
Your new theme will need a name. Try and think of something short and memorable - and make sure it is not a name that has already been used by someone else. A quick search on the moodle.org/plugins can save you a lot of work renaming things later.&lt;br /&gt;
&lt;br /&gt;
Lets call our new example theme &amp;quot;brands&amp;quot; as we will add some settings to allow &amp;quot;branding&amp;quot; in various places in Moodle.&lt;br /&gt;
&lt;br /&gt;
=== Starting files ===&lt;br /&gt;
As a plugin, themes must start with the basic structure of a plugin in Moodle. See https://docs.moodle.org/dev/Tutorial#The_skeleton_of_your_plugin for an overview of the files common to all plugins in Moodle.&lt;br /&gt;
&lt;br /&gt;
Following this guide we can start creating our theme. First we create the folder for the new theme under under &amp;quot;/theme/&amp;quot; folder in the Moodle root directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
/theme/picture/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to add some standard plugin files to our theme. First is version.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/version.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// This is the version of the plugin.&lt;br /&gt;
$plugin-&amp;gt;version = 2019030400;&lt;br /&gt;
&lt;br /&gt;
// This is the version of Moodle this plugin requires.&lt;br /&gt;
$plugin-&amp;gt;requires = 2018051700;&lt;br /&gt;
&lt;br /&gt;
// This is the component name of the plugin - it always starts with &#039;theme_&#039;&lt;br /&gt;
// for themes and should be the same as the name of the folder.&lt;br /&gt;
$plugin-&amp;gt;component = &#039;theme_picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is a list of plugins, this plugin depends on (and their versions).&lt;br /&gt;
$plugin-&amp;gt;dependencies = [&lt;br /&gt;
    &#039;theme_classic&#039; =&amp;gt; 2018120700&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
// This is a stable release.&lt;br /&gt;
$plugin-&amp;gt;maturity = MATURITY_STABLE;&lt;br /&gt;
&lt;br /&gt;
// This is the named version.&lt;br /&gt;
$plugin-&amp;gt;release = 1.0;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need a language file so that all our strings can be translated into different languages. The name of this file is the component name of our plugin and it sits in the lang/en/ folder for our plugin. We can include translations of our plugin, but we can also provide translations via the https://lang.moodle.org/ website once our plugin has been published to the plugins database at http://www.moodle.org/plugins/.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/lang/en/theme_picture.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// A description shown in the admin theme selector.&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Theme picture is a child theme of the Classic. It adds the ability to upload background photos.&#039;;&lt;br /&gt;
// The name of our plugin.&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Picture&#039;;&lt;br /&gt;
// We need to include a lang string for each block region.&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Theme specific files ===&lt;br /&gt;
Theme plugins have a few more standard files they need to define.&lt;br /&gt;
&lt;br /&gt;
Themes require a favicon file to show in the address bar. See [[http://docs.moodle.org/en/Favicon Favicon]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/favicon.ico&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes also require an example screenshot to be displayed in the theme selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/screenshot.jpg&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes require a lib.php file. This file contains callbacks used by various API&#039;s in Moodle. Initially this file can be empty, but as we add features to our theme we will need to add some functions here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// We will add callbacks here as we add features to our theme.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Theme config goes in a config.php file. This is one of the most important files in our theme. Once we add this file we will be ready to test our theme for the first time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of Moodle - http://moodle.org/&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Picture config.&lt;br /&gt;
 *&lt;br /&gt;
 * @package   theme_picture&lt;br /&gt;
 * @copyright 2016 Damyon Wiese&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// $THEME is defined before this page is included and we can define settings by adding properties to this global object.&lt;br /&gt;
&lt;br /&gt;
// The first setting we need is the name of the theme. This should be the last part of the component name, and the same&lt;br /&gt;
// as the directory name for our theme.&lt;br /&gt;
$THEME-&amp;gt;name = &#039;picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This setting list the style sheets we want to include in our theme. Because we want to use SCSS instead of CSS - we won&#039;t&lt;br /&gt;
// list any style sheets. If we did we would list the name of a file in the /styles/ folder for our theme without any css file&lt;br /&gt;
// extensions.&lt;br /&gt;
$THEME-&amp;gt;sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a setting that can be used to provide some styling to the content in the TinyMCE text editor. This is no longer the&lt;br /&gt;
// default text editor and &amp;quot;Atto&amp;quot; does not need this setting so we won&#039;t provide anything. If we did it would work the same&lt;br /&gt;
// as the previous setting - listing a file in the /styles/ folder.&lt;br /&gt;
$THEME-&amp;gt;editor_sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a critical setting. We want to inherit from theme_classic because it provides a great starting point for SCSS bootstrap4&lt;br /&gt;
// themes. We have added add more than one parent here to inherit from multiple parents, and if we did they would be processed in&lt;br /&gt;
// order of importance (later themes overriding earlier ones). Things we will inherit from the parent theme include&lt;br /&gt;
// styles and mustache templates and some (not all) settings.&lt;br /&gt;
$THEME-&amp;gt;parents = [&#039;boost&#039;, &#039;classic&#039;];&lt;br /&gt;
&lt;br /&gt;
// A dock is a way to take blocks out of the page and put them in a persistent floating area on the side of the page.&lt;br /&gt;
// does not support a dock so we won&#039;t either - but look at bootstrapbase for an example of a theme with a dock.&lt;br /&gt;
$THEME-&amp;gt;enable_dock = false;&lt;br /&gt;
&lt;br /&gt;
// This is an old setting used to load specific CSS for some YUI JS. We don&#039;t need it in Classic based themes because Classic&lt;br /&gt;
// provides default styling for the YUI modules that we use. It is not recommended to use this setting anymore.&lt;br /&gt;
$THEME-&amp;gt;yuicssmodules = array();&lt;br /&gt;
&lt;br /&gt;
// Most themes will use this rendererfactory as this is the one that allows the theme to override any other renderer.&lt;br /&gt;
$THEME-&amp;gt;rendererfactory = &#039;theme_overridden_renderer_factory&#039;;&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_picture_get_pre_scss&#039;;&lt;br /&gt;
&lt;br /&gt;
// Since we are using 2 parent themes the correct location of the layout files needs to be define. For this theme we need the multiple&lt;br /&gt;
// column layouts.&lt;br /&gt;
$THEME-&amp;gt;layouts = [&lt;br /&gt;
    // Most backwards compatible layout without the blocks - this is the layout used by default.&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Standard layout with blocks, this is recommended for most pages with general information.&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Main course page.&lt;br /&gt;
    &#039;course&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;coursecategory&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Part of course, typical for modules - default page layout if $cm specified in require_login().&lt;br /&gt;
    &#039;incourse&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The site home page.&lt;br /&gt;
    &#039;frontpage&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofullheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Server administration scripts.&lt;br /&gt;
    &#039;admin&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // My dashboard page.&lt;br /&gt;
    &#039;mydashboard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nonavbar&#039; =&amp;gt; true, &#039;langmenu&#039; =&amp;gt; true, &#039;nocontextheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // My public page.&lt;br /&gt;
    &#039;mypublic&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;login&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;boost&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;login.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    // Pages that appear in pop-up windows - no navigation, no blocks, no header.&lt;br /&gt;
    &#039;popup&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // No blocks and minimal footer - used for legacy frame layouts only!&lt;br /&gt;
    &#039;frametop&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nocoursefooter&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible.&lt;br /&gt;
    &#039;embedded&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array()&lt;br /&gt;
    ),&lt;br /&gt;
    // Used during upgrade and install, and for the &#039;This site is undergoing maintenance&#039; message.&lt;br /&gt;
    // This must not have any blocks, links, or API calls that would lead to database or cache interaction.&lt;br /&gt;
    // Please be extremely careful if you are modifying this layout.&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;maintenance.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Should display the content and basic headers only.&lt;br /&gt;
    &#039;print&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; false),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used when a redirection is occuring.&lt;br /&gt;
    &#039;redirect&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for reports.&lt;br /&gt;
    &#039;report&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for safebrowser and securewindow.&lt;br /&gt;
    &#039;secure&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;secure.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;&lt;br /&gt;
    )&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ready set go! ===&lt;br /&gt;
If you have been following along - now we are at the point where we can actually install and test our new theme. Try it now by visiting the admin notifications page to install the new plugin, and then choosing the new theme from the theme selector.&lt;br /&gt;
&lt;br /&gt;
[[https://docs.moodle.org/en/Standard_themes#Theme_selector Theme selector]]&lt;br /&gt;
&lt;br /&gt;
When you choose the new theme - you will find that it looks exactly the same as Classic. At this point with our minimal configuration - we are inheriting almost everything from our parent theme including styles and templates. You will notice though that we don&#039;t inherit the settings from our parent theme. If you choose a different preset in Classic - it is not applied in this child theme.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thats it for this tutorial, but there are [[:Category:Themes| more Themes docs]] to browse.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55646</id>
		<title>Creating a theme based on classic</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55646"/>
		<updated>2019-03-05T15:48:11Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Theme specific files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.6}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
This is a tutorial for how to create a new theme based on the Classic theme.&lt;br /&gt;
&lt;br /&gt;
Moodle 3.7 includes a new core theme named &amp;quot;Classic&amp;quot; which is a starting point for themers wanting to build Moodle theme using a 3 column layout without the Boost navdrawer and settings menus.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
What is a theme? A theme in Moodle is just another type of plugin that can be developed. Themes are responsible for setting up the structure of each page and have the ability to customise the output of any page in Moodle.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on a the tutorial https://docs.moodle.org/dev/Creating_a_theme_based_on_boost. You can download it or view the source code for it here: https://github.com/bmbrands/moodle-theme_picture&lt;br /&gt;
&lt;br /&gt;
=== Choosing a name ===&lt;br /&gt;
Your new theme will need a name. Try and think of something short and memorable - and make sure it is not a name that has already been used by someone else. A quick search on the moodle.org/plugins can save you a lot of work renaming things later.&lt;br /&gt;
&lt;br /&gt;
Lets call our new example theme &amp;quot;brands&amp;quot; as we will add some settings to allow &amp;quot;branding&amp;quot; in various places in Moodle.&lt;br /&gt;
&lt;br /&gt;
=== Starting files ===&lt;br /&gt;
As a plugin, themes must start with the basic structure of a plugin in Moodle. See https://docs.moodle.org/dev/Tutorial#The_skeleton_of_your_plugin for an overview of the files common to all plugins in Moodle.&lt;br /&gt;
&lt;br /&gt;
Following this guide we can start creating our theme. First we create the folder for the new theme under under &amp;quot;/theme/&amp;quot; folder in the Moodle root directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
/theme/picture/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to add some standard plugin files to our theme. First is version.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/version.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// This is the version of the plugin.&lt;br /&gt;
$plugin-&amp;gt;version = 2019030400;&lt;br /&gt;
&lt;br /&gt;
// This is the version of Moodle this plugin requires.&lt;br /&gt;
$plugin-&amp;gt;requires = 2018051700;&lt;br /&gt;
&lt;br /&gt;
// This is the component name of the plugin - it always starts with &#039;theme_&#039;&lt;br /&gt;
// for themes and should be the same as the name of the folder.&lt;br /&gt;
$plugin-&amp;gt;component = &#039;theme_picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is a list of plugins, this plugin depends on (and their versions).&lt;br /&gt;
$plugin-&amp;gt;dependencies = [&lt;br /&gt;
    &#039;theme_classic&#039; =&amp;gt; 2018120700&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
// This is a stable release.&lt;br /&gt;
$plugin-&amp;gt;maturity = MATURITY_STABLE;&lt;br /&gt;
&lt;br /&gt;
// This is the named version.&lt;br /&gt;
$plugin-&amp;gt;release = 1.0;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need a language file so that all our strings can be translated into different languages. The name of this file is the component name of our plugin and it sits in the lang/en/ folder for our plugin. We can include translations of our plugin, but we can also provide translations via the https://lang.moodle.org/ website once our plugin has been published to the plugins database at http://www.moodle.org/plugins/.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/lang/en/theme_picture.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// A description shown in the admin theme selector.&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Theme picture is a child theme of the Classic. It adds the ability to upload background photos.&#039;;&lt;br /&gt;
// The name of our plugin.&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Picture&#039;;&lt;br /&gt;
// We need to include a lang string for each block region.&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Theme specific files ===&lt;br /&gt;
Theme plugins have a few more standard files they need to define.&lt;br /&gt;
&lt;br /&gt;
Themes require a favicon file to show in the address bar. See [[http://docs.moodle.org/en/Favicon Favicon]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/favicon.ico&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes also require an example screenshot to be displayed in the theme selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/screenshot.jpg&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes require a lib.php file. This file contains callbacks used by various API&#039;s in Moodle. Initially this file can be empty, but as we add features to our theme we will need to add some functions here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// We will add callbacks here as we add features to our theme.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Theme config goes in a config.php file. This is one of the most important files in our theme. Once we add this file we will be ready to test our theme for the first time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of Moodle - http://moodle.org/&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Picture config.&lt;br /&gt;
 *&lt;br /&gt;
 * @package   theme_picture&lt;br /&gt;
 * @copyright 2016 Damyon Wiese&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// $THEME is defined before this page is included and we can define settings by adding properties to this global object.&lt;br /&gt;
&lt;br /&gt;
// The first setting we need is the name of the theme. This should be the last part of the component name, and the same&lt;br /&gt;
// as the directory name for our theme.&lt;br /&gt;
$THEME-&amp;gt;name = &#039;picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This setting list the style sheets we want to include in our theme. Because we want to use SCSS instead of CSS - we won&#039;t&lt;br /&gt;
// list any style sheets. If we did we would list the name of a file in the /styles/ folder for our theme without any css file&lt;br /&gt;
// extensions.&lt;br /&gt;
$THEME-&amp;gt;sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a setting that can be used to provide some styling to the content in the TinyMCE text editor. This is no longer the&lt;br /&gt;
// default text editor and &amp;quot;Atto&amp;quot; does not need this setting so we won&#039;t provide anything. If we did it would work the same&lt;br /&gt;
// as the previous setting - listing a file in the /styles/ folder.&lt;br /&gt;
$THEME-&amp;gt;editor_sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a critical setting. We want to inherit from theme_classic because it provides a great starting point for SCSS bootstrap4&lt;br /&gt;
// themes. We have added add more than one parent here to inherit from multiple parents, and if we did they would be processed in&lt;br /&gt;
// order of importance (later themes overriding earlier ones). Things we will inherit from the parent theme include&lt;br /&gt;
// styles and mustache templates and some (not all) settings.&lt;br /&gt;
$THEME-&amp;gt;parents = [&#039;boost&#039;, &#039;classic&#039;];&lt;br /&gt;
&lt;br /&gt;
// A dock is a way to take blocks out of the page and put them in a persistent floating area on the side of the page.&lt;br /&gt;
// does not support a dock so we won&#039;t either - but look at bootstrapbase for an example of a theme with a dock.&lt;br /&gt;
$THEME-&amp;gt;enable_dock = false;&lt;br /&gt;
&lt;br /&gt;
// This is an old setting used to load specific CSS for some YUI JS. We don&#039;t need it in Classic based themes because Classic&lt;br /&gt;
// provides default styling for the YUI modules that we use. It is not recommended to use this setting anymore.&lt;br /&gt;
$THEME-&amp;gt;yuicssmodules = array();&lt;br /&gt;
&lt;br /&gt;
// Most themes will use this rendererfactory as this is the one that allows the theme to override any other renderer.&lt;br /&gt;
$THEME-&amp;gt;rendererfactory = &#039;theme_overridden_renderer_factory&#039;;&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_picture_get_pre_scss&#039;;&lt;br /&gt;
&lt;br /&gt;
// Since we are using 2 parent themes the correct location of the layout files needs to be define. For this theme we need the multiple&lt;br /&gt;
// column layouts.&lt;br /&gt;
$THEME-&amp;gt;layouts = [&lt;br /&gt;
    // Most backwards compatible layout without the blocks - this is the layout used by default.&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Standard layout with blocks, this is recommended for most pages with general information.&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Main course page.&lt;br /&gt;
    &#039;course&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;coursecategory&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Part of course, typical for modules - default page layout if $cm specified in require_login().&lt;br /&gt;
    &#039;incourse&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The site home page.&lt;br /&gt;
    &#039;frontpage&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofullheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Server administration scripts.&lt;br /&gt;
    &#039;admin&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // My dashboard page.&lt;br /&gt;
    &#039;mydashboard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nonavbar&#039; =&amp;gt; true, &#039;langmenu&#039; =&amp;gt; true, &#039;nocontextheader&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // My public page.&lt;br /&gt;
    &#039;mypublic&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;login&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;boost&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;login.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    // Pages that appear in pop-up windows - no navigation, no blocks, no header.&lt;br /&gt;
    &#039;popup&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // No blocks and minimal footer - used for legacy frame layouts only!&lt;br /&gt;
    &#039;frametop&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nocoursefooter&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible.&lt;br /&gt;
    &#039;embedded&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array()&lt;br /&gt;
    ),&lt;br /&gt;
    // Used during upgrade and install, and for the &#039;This site is undergoing maintenance&#039; message.&lt;br /&gt;
    // This must not have any blocks, links, or API calls that would lead to database or cache interaction.&lt;br /&gt;
    // Please be extremely careful if you are modifying this layout.&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;maintenance.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Should display the content and basic headers only.&lt;br /&gt;
    &#039;print&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;contentonly.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; false),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used when a redirection is occuring.&lt;br /&gt;
    &#039;redirect&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for reports.&lt;br /&gt;
    &#039;report&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for safebrowser and securewindow.&lt;br /&gt;
    &#039;secure&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;classic&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;secure.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;&lt;br /&gt;
    )&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
// This is the function that returns the SCSS source for the main file in our theme. We override the boost version because&lt;br /&gt;
// we want to allow presets uploaded to our own theme file area to be selected in the preset list.&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_picture_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ready set go! ===&lt;br /&gt;
If you have been following along - now we are at the point where we can actually install and test our new theme. Try it now by visiting the admin notifications page to install the new plugin, and then choosing the new theme from the theme selector.&lt;br /&gt;
&lt;br /&gt;
[[https://docs.moodle.org/en/Standard_themes#Theme_selector Theme selector]]&lt;br /&gt;
&lt;br /&gt;
When you choose the new theme - you will find that it looks exactly the same as Classic. At this point with our minimal configuration - we are inheriting almost everything from our parent theme including styles and templates. You will notice though that we don&#039;t inherit the settings from our parent theme. If you choose a different preset in Classic - it is not applied in this child theme.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thats it for this tutorial, but there are [[:Category:Themes| more Themes docs]] to browse.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Themes&amp;diff=55642</id>
		<title>Themes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Themes&amp;diff=55642"/>
		<updated>2019-03-05T07:23:49Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a starting point for Moodle theme developers.&lt;br /&gt;
&lt;br /&gt;
For documentation on installing and using themes, please see the [[:en:Themes|Themes user documentation]] and [[:en:Themes FAQ|Themes FAQ]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Moodle has a powerful themes system that allows for a variety of effects through the use of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
* [[Themes overview]]&lt;br /&gt;
* [[Creating a theme based on boost]]&lt;br /&gt;
* [[Creating a theme based on classic]]&lt;br /&gt;
* [[Moving your theme to use boost as a parent theme]]&lt;br /&gt;
* [[Updating a boost based theme]]&lt;br /&gt;
* [[Using images in a theme|Using images]]&lt;br /&gt;
* [[Creating a theme settings page|Theme settings page]]&lt;br /&gt;
* [[Adding theme upgrade code]]&lt;br /&gt;
* [[Extending the theme custom menu|Extending the custom menu]]&lt;br /&gt;
* [[Overriding a renderer]]&lt;br /&gt;
* [[Theme checklist]]&lt;br /&gt;
* [[Templates]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Themes|List of all themes-related developer documentation]]&lt;br /&gt;
* [http://youtu.be/K3MYE8am7M4 Install a New Theme]  MoodleBites video on YouTube &lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55640</id>
		<title>Creating a theme based on classic</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55640"/>
		<updated>2019-03-04T16:51:57Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Getting started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.6}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
This is a tutorial for how to create a new theme based on the Classic theme.&lt;br /&gt;
&lt;br /&gt;
Moodle 3.7 includes a new core theme named &amp;quot;Classic&amp;quot; which is a starting point for themers wanting to build Moodle theme using a 3 column layout without the Boost navdrawer and settings menus.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
What is a theme? A theme in Moodle is just another type of plugin that can be developed. Themes are responsible for setting up the structure of each page and have the ability to customise the output of any page in Moodle.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on a the tutorial https://docs.moodle.org/dev/Creating_a_theme_based_on_boost. You can download it or view the source code for it here: https://github.com/bmbrands/moodle-theme_picture&lt;br /&gt;
&lt;br /&gt;
=== Choosing a name ===&lt;br /&gt;
Your new theme will need a name. Try and think of something short and memorable - and make sure it is not a name that has already been used by someone else. A quick search on the moodle.org/plugins can save you a lot of work renaming things later.&lt;br /&gt;
&lt;br /&gt;
Lets call our new example theme &amp;quot;brands&amp;quot; as we will add some settings to allow &amp;quot;branding&amp;quot; in various places in Moodle.&lt;br /&gt;
&lt;br /&gt;
=== Starting files ===&lt;br /&gt;
As a plugin, themes must start with the basic structure of a plugin in Moodle. See https://docs.moodle.org/dev/Tutorial#The_skeleton_of_your_plugin for an overview of the files common to all plugins in Moodle.&lt;br /&gt;
&lt;br /&gt;
Following this guide we can start creating our theme. First we create the folder for the new theme under under &amp;quot;/theme/&amp;quot; folder in the Moodle root directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
/theme/picture/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to add some standard plugin files to our theme. First is version.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/version.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// This is the version of the plugin.&lt;br /&gt;
$plugin-&amp;gt;version = 2019030400;&lt;br /&gt;
&lt;br /&gt;
// This is the version of Moodle this plugin requires.&lt;br /&gt;
$plugin-&amp;gt;requires = 2018051700;&lt;br /&gt;
&lt;br /&gt;
// This is the component name of the plugin - it always starts with &#039;theme_&#039;&lt;br /&gt;
// for themes and should be the same as the name of the folder.&lt;br /&gt;
$plugin-&amp;gt;component = &#039;theme_picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is a list of plugins, this plugin depends on (and their versions).&lt;br /&gt;
$plugin-&amp;gt;dependencies = [&lt;br /&gt;
    &#039;theme_classic&#039; =&amp;gt; 2018120700&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
// This is a stable release.&lt;br /&gt;
$plugin-&amp;gt;maturity = MATURITY_STABLE;&lt;br /&gt;
&lt;br /&gt;
// This is the named version.&lt;br /&gt;
$plugin-&amp;gt;release = 1.0;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need a language file so that all our strings can be translated into different languages. The name of this file is the component name of our plugin and it sits in the lang/en/ folder for our plugin. We can include translations of our plugin, but we can also provide translations via the https://lang.moodle.org/ website once our plugin has been published to the plugins database at http://www.moodle.org/plugins/.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/lang/en/theme_picture.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// A description shown in the admin theme selector.&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Theme picture is a child theme of the Classic. It adds the ability to upload background photos.&#039;;&lt;br /&gt;
// The name of our plugin.&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Picture&#039;;&lt;br /&gt;
// We need to include a lang string for each block region.&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Theme specific files ===&lt;br /&gt;
Theme plugins have a few more standard files they need to define.&lt;br /&gt;
&lt;br /&gt;
Themes require a favicon file to show in the address bar. See [[http://docs.moodle.org/en/Favicon Favicon]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/favicon.ico&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes also require an example screenshot to be displayed in the theme selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/screenshot.jpg&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes require a lib.php file. This file contains callbacks used by various API&#039;s in Moodle. Initially this file can be empty, but as we add features to our theme we will need to add some functions here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// We will add callbacks here as we add features to our theme.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Theme config goes in a config.php file. This is one of the most important files in our theme. Once we add this file we will be ready to test our theme for the first time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of Moodle - http://moodle.org/&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Picture config.&lt;br /&gt;
 *&lt;br /&gt;
 * @package   theme_picture&lt;br /&gt;
 * @copyright 2016 Damyon Wiese&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// $THEME is defined before this page is included and we can define settings by adding properties to this global object.&lt;br /&gt;
&lt;br /&gt;
// The first setting we need is the name of the theme. This should be the last part of the component name, and the same&lt;br /&gt;
// as the directory name for our theme.&lt;br /&gt;
$THEME-&amp;gt;name = &#039;picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This setting list the style sheets we want to include in our theme. Because we want to use SCSS instead of CSS - we won&#039;t&lt;br /&gt;
// list any style sheets. If we did we would list the name of a file in the /styles/ folder for our theme without any css file&lt;br /&gt;
// extensions.&lt;br /&gt;
$THEME-&amp;gt;sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a setting that can be used to provide some styling to the content in the TinyMCE text editor. This is no longer the&lt;br /&gt;
// default text editor and &amp;quot;Atto&amp;quot; does not need this setting so we won&#039;t provide anything. If we did it would work the same&lt;br /&gt;
// as the previous setting - listing a file in the /styles/ folder.&lt;br /&gt;
$THEME-&amp;gt;editor_sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a critical setting. We want to inherit from theme_classic because it provides a great starting point for SCSS bootstrap4&lt;br /&gt;
// themes. We could add more than one parent here to inherit from multiple parents, and if we did they would be processed in&lt;br /&gt;
// order of importance (later themes overriding earlier ones). Things we will inherit from the parent theme include&lt;br /&gt;
// styles and mustache templates and some (not all) settings.&lt;br /&gt;
$THEME-&amp;gt;parents = [&#039;classic&#039;];&lt;br /&gt;
&lt;br /&gt;
// A dock is a way to take blocks out of the page and put them in a persistent floating area on the side of the page.&lt;br /&gt;
// does not support a dock so we won&#039;t either - but look at bootstrapbase for an example of a theme with a dock.&lt;br /&gt;
$THEME-&amp;gt;enable_dock = false;&lt;br /&gt;
&lt;br /&gt;
// This is an old setting used to load specific CSS for some YUI JS. We don&#039;t need it in Classic based themes because Classic&lt;br /&gt;
// provides default styling for the YUI modules that we use. It is not recommended to use this setting anymore.&lt;br /&gt;
$THEME-&amp;gt;yuicssmodules = array();&lt;br /&gt;
&lt;br /&gt;
// Most themes will use this rendererfactory as this is the one that allows the theme to override any other renderer.&lt;br /&gt;
$THEME-&amp;gt;rendererfactory = &#039;theme_overridden_renderer_factory&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is a list of blocks that are required to exist on all pages for this theme to function correctly. For example&lt;br /&gt;
// bootstrap base requires the settings and navigation blocks because otherwise there would be no way to navigate to all the&lt;br /&gt;
// pages in Moodle. Classic does not require these blocks because it provides other ways to navigate built into the theme.&lt;br /&gt;
$THEME-&amp;gt;requiredblocks = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is the function that returns the SCSS source for the main file in our theme. We override the boost version because&lt;br /&gt;
// we want to allow presets uploaded to our own theme file area to be selected in the preset list.&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_picture_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ready set go! ===&lt;br /&gt;
If you have been following along - now we are at the point where we can actually install and test our new theme. Try it now by visiting the admin notifications page to install the new plugin, and then choosing the new theme from the theme selector.&lt;br /&gt;
&lt;br /&gt;
[[https://docs.moodle.org/en/Standard_themes#Theme_selector Theme selector]]&lt;br /&gt;
&lt;br /&gt;
When you choose the new theme - you will find that it looks exactly the same as Classic. At this point with our minimal configuration - we are inheriting almost everything from our parent theme including styles and templates. You will notice though that we don&#039;t inherit the settings from our parent theme. If you choose a different preset in Classic - it is not applied in this child theme.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thats it for this tutorial, but there are [[:Category:Themes| more Themes docs]] to browse.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55639</id>
		<title>Creating a theme based on classic</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme_based_on_classic&amp;diff=55639"/>
		<updated>2019-03-04T15:22:16Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: Created page with &amp;quot;{{Moodle 3.6}} {{Template:Themes}}  This is a tutorial for how to create a new theme based on the Classic theme.  Moodle 3.7 includes a new core theme named &amp;quot;Classic&amp;quot; which is...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.6}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
This is a tutorial for how to create a new theme based on the Classic theme.&lt;br /&gt;
&lt;br /&gt;
Moodle 3.7 includes a new core theme named &amp;quot;Classic&amp;quot; which is a starting point for themers wanting to build Moodle theme using a 3 column layout without the Boost navdrawer and settings menus.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
What is a theme? A theme in Moodle is just another type of plugin that can be developed. Themes are responsible for setting up the structure of each page and have the ability to customise the output of any page in Moodle.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on a the tutorial [Creating_a_theme_based_on_boost Creating a theme based on boost].&lt;br /&gt;
&lt;br /&gt;
=== Choosing a name ===&lt;br /&gt;
Your new theme will need a name. Try and think of something short and memorable - and make sure it is not a name that has already been used by someone else. A quick search on the moodle.org/plugins can save you a lot of work renaming things later.&lt;br /&gt;
&lt;br /&gt;
Lets call our new example theme &amp;quot;brands&amp;quot; as we will add some settings to allow &amp;quot;branding&amp;quot; in various places in Moodle.&lt;br /&gt;
&lt;br /&gt;
=== Starting files ===&lt;br /&gt;
As a plugin, themes must start with the basic structure of a plugin in Moodle. See https://docs.moodle.org/dev/Tutorial#The_skeleton_of_your_plugin for an overview of the files common to all plugins in Moodle.&lt;br /&gt;
&lt;br /&gt;
Following this guide we can start creating our theme. First we create the folder for the new theme under under &amp;quot;/theme/&amp;quot; folder in the Moodle root directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
/theme/picture/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to add some standard plugin files to our theme. First is version.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/version.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// This is the version of the plugin.&lt;br /&gt;
$plugin-&amp;gt;version = 2019030400;&lt;br /&gt;
&lt;br /&gt;
// This is the version of Moodle this plugin requires.&lt;br /&gt;
$plugin-&amp;gt;requires = 2018051700;&lt;br /&gt;
&lt;br /&gt;
// This is the component name of the plugin - it always starts with &#039;theme_&#039;&lt;br /&gt;
// for themes and should be the same as the name of the folder.&lt;br /&gt;
$plugin-&amp;gt;component = &#039;theme_picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is a list of plugins, this plugin depends on (and their versions).&lt;br /&gt;
$plugin-&amp;gt;dependencies = [&lt;br /&gt;
    &#039;theme_classic&#039; =&amp;gt; 2018120700&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
// This is a stable release.&lt;br /&gt;
$plugin-&amp;gt;maturity = MATURITY_STABLE;&lt;br /&gt;
&lt;br /&gt;
// This is the named version.&lt;br /&gt;
$plugin-&amp;gt;release = 1.0;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need a language file so that all our strings can be translated into different languages. The name of this file is the component name of our plugin and it sits in the lang/en/ folder for our plugin. We can include translations of our plugin, but we can also provide translations via the https://lang.moodle.org/ website once our plugin has been published to the plugins database at http://www.moodle.org/plugins/.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/theme/picture/lang/en/theme_picture.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// A description shown in the admin theme selector.&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Theme picture is a child theme of the Classic. It adds the ability to upload background photos.&#039;;&lt;br /&gt;
// The name of our plugin.&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Picture&#039;;&lt;br /&gt;
// We need to include a lang string for each block region.&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Theme specific files ===&lt;br /&gt;
Theme plugins have a few more standard files they need to define.&lt;br /&gt;
&lt;br /&gt;
Themes require a favicon file to show in the address bar. See [[http://docs.moodle.org/en/Favicon Favicon]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/favicon.ico&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes also require an example screenshot to be displayed in the theme selector.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;pix/screenshot.jpg&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Image file not shown).&lt;br /&gt;
&lt;br /&gt;
Themes require a lib.php file. This file contains callbacks used by various API&#039;s in Moodle. Initially this file can be empty, but as we add features to our theme we will need to add some functions here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;lib.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// Every file should have GPL and copyright in the header - we skip it in tutorials but you should not skip it for real.&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// We will add callbacks here as we add features to our theme.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Theme config goes in a config.php file. This is one of the most important files in our theme. Once we add this file we will be ready to test our theme for the first time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of Moodle - http://moodle.org/&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Picture config.&lt;br /&gt;
 *&lt;br /&gt;
 * @package   theme_picture&lt;br /&gt;
 * @copyright 2016 Damyon Wiese&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// This line protects the file from being accessed by a URL directly.&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
// $THEME is defined before this page is included and we can define settings by adding properties to this global object.&lt;br /&gt;
&lt;br /&gt;
// The first setting we need is the name of the theme. This should be the last part of the component name, and the same&lt;br /&gt;
// as the directory name for our theme.&lt;br /&gt;
$THEME-&amp;gt;name = &#039;picture&#039;;&lt;br /&gt;
&lt;br /&gt;
// This setting list the style sheets we want to include in our theme. Because we want to use SCSS instead of CSS - we won&#039;t&lt;br /&gt;
// list any style sheets. If we did we would list the name of a file in the /styles/ folder for our theme without any css file&lt;br /&gt;
// extensions.&lt;br /&gt;
$THEME-&amp;gt;sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a setting that can be used to provide some styling to the content in the TinyMCE text editor. This is no longer the&lt;br /&gt;
// default text editor and &amp;quot;Atto&amp;quot; does not need this setting so we won&#039;t provide anything. If we did it would work the same&lt;br /&gt;
// as the previous setting - listing a file in the /styles/ folder.&lt;br /&gt;
$THEME-&amp;gt;editor_sheets = [];&lt;br /&gt;
&lt;br /&gt;
// This is a critical setting. We want to inherit from theme_classic because it provides a great starting point for SCSS bootstrap4&lt;br /&gt;
// themes. We could add more than one parent here to inherit from multiple parents, and if we did they would be processed in&lt;br /&gt;
// order of importance (later themes overriding earlier ones). Things we will inherit from the parent theme include&lt;br /&gt;
// styles and mustache templates and some (not all) settings.&lt;br /&gt;
$THEME-&amp;gt;parents = [&#039;classic&#039;];&lt;br /&gt;
&lt;br /&gt;
// A dock is a way to take blocks out of the page and put them in a persistent floating area on the side of the page.&lt;br /&gt;
// does not support a dock so we won&#039;t either - but look at bootstrapbase for an example of a theme with a dock.&lt;br /&gt;
$THEME-&amp;gt;enable_dock = false;&lt;br /&gt;
&lt;br /&gt;
// This is an old setting used to load specific CSS for some YUI JS. We don&#039;t need it in Classic based themes because Classic&lt;br /&gt;
// provides default styling for the YUI modules that we use. It is not recommended to use this setting anymore.&lt;br /&gt;
$THEME-&amp;gt;yuicssmodules = array();&lt;br /&gt;
&lt;br /&gt;
// Most themes will use this rendererfactory as this is the one that allows the theme to override any other renderer.&lt;br /&gt;
$THEME-&amp;gt;rendererfactory = &#039;theme_overridden_renderer_factory&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is a list of blocks that are required to exist on all pages for this theme to function correctly. For example&lt;br /&gt;
// bootstrap base requires the settings and navigation blocks because otherwise there would be no way to navigate to all the&lt;br /&gt;
// pages in Moodle. Classic does not require these blocks because it provides other ways to navigate built into the theme.&lt;br /&gt;
$THEME-&amp;gt;requiredblocks = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
// This is the function that returns the SCSS source for the main file in our theme. We override the boost version because&lt;br /&gt;
// we want to allow presets uploaded to our own theme file area to be selected in the preset list.&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_picture_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ready set go! ===&lt;br /&gt;
If you have been following along - now we are at the point where we can actually install and test our new theme. Try it now by visiting the admin notifications page to install the new plugin, and then choosing the new theme from the theme selector.&lt;br /&gt;
&lt;br /&gt;
[[https://docs.moodle.org/en/Standard_themes#Theme_selector Theme selector]]&lt;br /&gt;
&lt;br /&gt;
When you choose the new theme - you will find that it looks exactly the same as Classic. At this point with our minimal configuration - we are inheriting almost everything from our parent theme including styles and templates. You will notice though that we don&#039;t inherit the settings from our parent theme. If you choose a different preset in Classic - it is not applied in this child theme.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thats it for this tutorial, but there are [[:Category:Themes| more Themes docs]] to browse.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=55638</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=55638"/>
		<updated>2019-03-04T14:41:49Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.5}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. Most Boost child themes will need some updates for Moodle 3.5, this document has been written to help you understand what has been changed. And keep in mind, after your theme has been updated you will have access to the full range of Bootstrap 4 components and utilities which allow you to create amazing designs and layouts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;If you were using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] for styling the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in Boost presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [https://popper.js.org Popper] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [https://getbootstrap.com/docs/4.0/utilities/spacing/ Bootstrap spacing utilities] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [https://getbootstrap.com/docs/4.0/migration/#utilities Bootstrap utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [https://getbootstrap.com/docs/4.0/utilities/borders/ utility/helper classes] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=55637</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=55637"/>
		<updated>2019-03-04T14:41:38Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.2}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. Most Boost child themes will need some updates for Moodle 3.5, this document has been written to help you understand what has been changed. And keep in mind, after your theme has been updated you will have access to the full range of Bootstrap 4 components and utilities which allow you to create amazing designs and layouts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;If you were using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] for styling the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in Boost presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [https://popper.js.org Popper] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [https://getbootstrap.com/docs/4.0/utilities/spacing/ Bootstrap spacing utilities] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [https://getbootstrap.com/docs/4.0/migration/#utilities Bootstrap utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [https://getbootstrap.com/docs/4.0/utilities/borders/ utility/helper classes] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55636</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55636"/>
		<updated>2019-03-04T14:39:58Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.6}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Bootstrapbase uses Bootstrap version 2.3.3, Boost uses Bootstrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extension language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS uses a different css syntax than Sass. The most obvious difference is the way variables are defined; LESS uses @, Sass uses $. There are many other differences between LESS and Sass; [https://css-tricks.com/sass-vs-less/ css-tricks] has more information on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specify additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overridden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/bootstrapbase/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent and serve as an example.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialised in rendering custom widgets on the front page, so we only need to specify a different layout file for the front page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the front page.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
=== Migrating your LESS files ===&lt;br /&gt;
&lt;br /&gt;
The Bootstrapbase theme css is written in the [http://lesscss.org/ LESS css extention language]. Some child themes of bootstrapbase use LESS to generate their stylesheets. Usually these files are stored in the less/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The Boost theme css is written in the [https://sass-lang.com/ Sass css extention language]. A child theme can extend the Boost Sass files which are usually found in the sass/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The LESS and Sass extention languages are different and not compatible,  themes using less will have to migrate their stylesheets. This can be done manually or with the [https://www.npmjs.com/package/less2sass less2sass] tool to translate LESS files into Sass. This tool is a great start when migrating your LESS however, after running less2sass to migrate your stylesheets you will need to inspect them and fix them if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Icon styles */&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
@icon-big-width: 64px;&lt;br /&gt;
@icon-big-height: 64px;&lt;br /&gt;
&lt;br /&gt;
img.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: @icon-big-width;&lt;br /&gt;
        height: @icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.groupinfobox {&lt;br /&gt;
    .well;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example less from theme/bootstrapbase/less/moodle/core.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
$icon-big-width: 64px;&lt;br /&gt;
$icon-big-height: 64px;&lt;br /&gt;
.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: $icon-big-width;&lt;br /&gt;
        height: $icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 .groupinfobox {&lt;br /&gt;
    @extend .card;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example sass from theme/boost/scss/moodle_core.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extension language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
When you start migrating your LESS file a good starting point is your theme variables.less. Usually child themes define a number of new variables and override some of the variables defined in theme/bootstrapbase/less/bootstrap/variables.less.&lt;br /&gt;
Your new variables will probably be okay when migrating to SASS. The overridden bootstrap variables will no longer be valid. So for each overridden variable try to find the new variables name in theme/boost/sass/bootstrap/_variables.scss.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Scaffolding&lt;br /&gt;
// -------------------------&lt;br /&gt;
@bodyBackground:        @white;&lt;br /&gt;
@textColor:             @grayDark;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
// -------------------------&lt;br /&gt;
@linkColor:             #08c;&lt;br /&gt;
@linkColorHover:        darken(@linkColor, 15%);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables from theme/bootstrapbase/less/bootstrap/variables.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Body&lt;br /&gt;
//&lt;br /&gt;
// Settings for the `&amp;lt;body&amp;gt;` element.&lt;br /&gt;
&lt;br /&gt;
$body-bg:                   $white !default;&lt;br /&gt;
$body-color:                $gray-900 !default;&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
//&lt;br /&gt;
// Style anchor elements.&lt;br /&gt;
&lt;br /&gt;
$link-color:                theme-color(&amp;quot;primary&amp;quot;) !default;&lt;br /&gt;
$link-decoration:           none !default;&lt;br /&gt;
$link-hover-color:          darken($link-color, 15%) !default;&lt;br /&gt;
$link-hover-decoration:     underline !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables form theme/boost/sass/bootstrap/_variables.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Using grunt to debug Sass compile issues ===&lt;br /&gt;
&lt;br /&gt;
When you start creating your new Sass files debugging what happens in the Moodle core PHP Sass compiler can take a lot of time. The compiler is run using a caching mechanism and error reporting is poor, when a variable is misspelled the errors are send to your webserver logfiles.&lt;br /&gt;
&lt;br /&gt;
To speed up development The [http://gruntjs.com/ Grunt] Javascript taskrunner that runs on [https://nodejs.org/en/ Node.js] can be very helpful. If you have not tried to get Grunt running for Moodle core tasks make sure you read the [https://docs.moodle.org/dev/Grunt Moodle Grunt] docs page for more info.&lt;br /&gt;
&lt;br /&gt;
You can use Grunt to compile your Sass and check your Sass syntaxs. Once you have Grunt and Node.js up and running you can create your own Gruntfile.js and package.json file.&lt;br /&gt;
&lt;br /&gt;
For theme Elegance these files are found in [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/Gruntfile.js theme/elegance/Gruntfile.js] and [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/postcss.js theme/elegance/package.json].&lt;br /&gt;
&lt;br /&gt;
You can copy these into your theme folder and run the Node installer to retreive all Node dependancies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
&amp;gt; nmp install&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you update the Gruntfile.js to reflect your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    sass: {&lt;br /&gt;
        options: {&lt;br /&gt;
            style: &#039;expanded&#039;&lt;br /&gt;
        },&lt;br /&gt;
        dist: {&lt;br /&gt;
            files: {&lt;br /&gt;
                &#039;style/elegance.css&#039;: &#039;scss/gruntcompile.scss&#039;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of the Grunfile.js you will need to change&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once all dependancies are installed you can run Grunt to watch your Sass files. Each time you make a change in any of the files the the Node compiler will run and create a new stylesheet in your theme&#039;s style/ folder&lt;br /&gt;
&lt;br /&gt;
This stylesheet will not be served to the end user unless you change your theme configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = [&#039;elegance&#039;];&lt;br /&gt;
&lt;br /&gt;
// Commented out to prevent PHP Sass compiling.&lt;br /&gt;
//$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
//    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
//};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Migrating your renderer files ===&lt;br /&gt;
&lt;br /&gt;
In Bootstrapbase the overriden renderers were located in theme/boost/renderers/. These renderes are stored in classes/output in the Boost.&lt;br /&gt;
&lt;br /&gt;
In theme Boost the overridden core renderer is located in theme/boost/classes/output/core_renderer.php. If your theme overrides the core renderer (/lib/outputrenderers.php) make sure you override the Boost renderer (In Moodle version 3.6 and below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of the elegance theme for Moodle&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
namespace theme_elegance\output;&lt;br /&gt;
&lt;br /&gt;
use \theme_boost\output\core_renderer as boost_core_renderer;&lt;br /&gt;
use stdClass;&lt;br /&gt;
use theme_config;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Renderers to align Moodle&#039;s HTML with that expected by Bootstrap&lt;br /&gt;
 *&lt;br /&gt;
 * @package    theme_elegance&lt;br /&gt;
 * @copyright  2019 Bas Brands&lt;br /&gt;
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
class core_renderer extends boost_core_renderer {&lt;br /&gt;
	 /**&lt;br /&gt;
     * Returns the title to use on the page.&lt;br /&gt;
     *&lt;br /&gt;
     * @since Moodle 2.5.1 2.6&lt;br /&gt;
     * @return string&lt;br /&gt;
     */&lt;br /&gt;
    public function page_title() {&lt;br /&gt;
        ...&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move your custom renderers or other overridden renderes to your themes classes/output folder too.&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55635</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55635"/>
		<updated>2019-03-04T14:38:49Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.2}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Bootstrapbase uses Bootstrap version 2.3.3, Boost uses Bootstrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extension language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS uses a different css syntax than Sass. The most obvious difference is the way variables are defined; LESS uses @, Sass uses $. There are many other differences between LESS and Sass; [https://css-tricks.com/sass-vs-less/ css-tricks] has more information on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specify additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overridden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/bootstrapbase/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent and serve as an example.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialised in rendering custom widgets on the front page, so we only need to specify a different layout file for the front page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the front page.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
=== Migrating your LESS files ===&lt;br /&gt;
&lt;br /&gt;
The Bootstrapbase theme css is written in the [http://lesscss.org/ LESS css extention language]. Some child themes of bootstrapbase use LESS to generate their stylesheets. Usually these files are stored in the less/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The Boost theme css is written in the [https://sass-lang.com/ Sass css extention language]. A child theme can extend the Boost Sass files which are usually found in the sass/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The LESS and Sass extention languages are different and not compatible,  themes using less will have to migrate their stylesheets. This can be done manually or with the [https://www.npmjs.com/package/less2sass less2sass] tool to translate LESS files into Sass. This tool is a great start when migrating your LESS however, after running less2sass to migrate your stylesheets you will need to inspect them and fix them if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Icon styles */&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
@icon-big-width: 64px;&lt;br /&gt;
@icon-big-height: 64px;&lt;br /&gt;
&lt;br /&gt;
img.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: @icon-big-width;&lt;br /&gt;
        height: @icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.groupinfobox {&lt;br /&gt;
    .well;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example less from theme/bootstrapbase/less/moodle/core.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
$icon-big-width: 64px;&lt;br /&gt;
$icon-big-height: 64px;&lt;br /&gt;
.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: $icon-big-width;&lt;br /&gt;
        height: $icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 .groupinfobox {&lt;br /&gt;
    @extend .card;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example sass from theme/boost/scss/moodle_core.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extension language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
When you start migrating your LESS file a good starting point is your theme variables.less. Usually child themes define a number of new variables and override some of the variables defined in theme/bootstrapbase/less/bootstrap/variables.less.&lt;br /&gt;
Your new variables will probably be okay when migrating to SASS. The overridden bootstrap variables will no longer be valid. So for each overridden variable try to find the new variables name in theme/boost/sass/bootstrap/_variables.scss.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Scaffolding&lt;br /&gt;
// -------------------------&lt;br /&gt;
@bodyBackground:        @white;&lt;br /&gt;
@textColor:             @grayDark;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
// -------------------------&lt;br /&gt;
@linkColor:             #08c;&lt;br /&gt;
@linkColorHover:        darken(@linkColor, 15%);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables from theme/bootstrapbase/less/bootstrap/variables.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Body&lt;br /&gt;
//&lt;br /&gt;
// Settings for the `&amp;lt;body&amp;gt;` element.&lt;br /&gt;
&lt;br /&gt;
$body-bg:                   $white !default;&lt;br /&gt;
$body-color:                $gray-900 !default;&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
//&lt;br /&gt;
// Style anchor elements.&lt;br /&gt;
&lt;br /&gt;
$link-color:                theme-color(&amp;quot;primary&amp;quot;) !default;&lt;br /&gt;
$link-decoration:           none !default;&lt;br /&gt;
$link-hover-color:          darken($link-color, 15%) !default;&lt;br /&gt;
$link-hover-decoration:     underline !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables form theme/boost/sass/bootstrap/_variables.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Using grunt to debug Sass compile issues ===&lt;br /&gt;
&lt;br /&gt;
When you start creating your new Sass files debugging what happens in the Moodle core PHP Sass compiler can take a lot of time. The compiler is run using a caching mechanism and error reporting is poor, when a variable is misspelled the errors are send to your webserver logfiles.&lt;br /&gt;
&lt;br /&gt;
To speed up development The [http://gruntjs.com/ Grunt] Javascript taskrunner that runs on [https://nodejs.org/en/ Node.js] can be very helpful. If you have not tried to get Grunt running for Moodle core tasks make sure you read the [https://docs.moodle.org/dev/Grunt Moodle Grunt] docs page for more info.&lt;br /&gt;
&lt;br /&gt;
You can use Grunt to compile your Sass and check your Sass syntaxs. Once you have Grunt and Node.js up and running you can create your own Gruntfile.js and package.json file.&lt;br /&gt;
&lt;br /&gt;
For theme Elegance these files are found in [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/Gruntfile.js theme/elegance/Gruntfile.js] and [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/postcss.js theme/elegance/package.json].&lt;br /&gt;
&lt;br /&gt;
You can copy these into your theme folder and run the Node installer to retreive all Node dependancies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
&amp;gt; nmp install&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you update the Gruntfile.js to reflect your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    sass: {&lt;br /&gt;
        options: {&lt;br /&gt;
            style: &#039;expanded&#039;&lt;br /&gt;
        },&lt;br /&gt;
        dist: {&lt;br /&gt;
            files: {&lt;br /&gt;
                &#039;style/elegance.css&#039;: &#039;scss/gruntcompile.scss&#039;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of the Grunfile.js you will need to change&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once all dependancies are installed you can run Grunt to watch your Sass files. Each time you make a change in any of the files the the Node compiler will run and create a new stylesheet in your theme&#039;s style/ folder&lt;br /&gt;
&lt;br /&gt;
This stylesheet will not be served to the end user unless you change your theme configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = [&#039;elegance&#039;];&lt;br /&gt;
&lt;br /&gt;
// Commented out to prevent PHP Sass compiling.&lt;br /&gt;
//$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
//    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
//};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Migrating your renderer files ===&lt;br /&gt;
&lt;br /&gt;
In Bootstrapbase the overriden renderers were located in theme/boost/renderers/. These renderes are stored in classes/output in the Boost.&lt;br /&gt;
&lt;br /&gt;
In theme Boost the overridden core renderer is located in theme/boost/classes/output/core_renderer.php. If your theme overrides the core renderer (/lib/outputrenderers.php) make sure you override the Boost renderer (In Moodle version 3.6 and below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of the elegance theme for Moodle&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
namespace theme_elegance\output;&lt;br /&gt;
&lt;br /&gt;
use \theme_boost\output\core_renderer as boost_core_renderer;&lt;br /&gt;
use stdClass;&lt;br /&gt;
use theme_config;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Renderers to align Moodle&#039;s HTML with that expected by Bootstrap&lt;br /&gt;
 *&lt;br /&gt;
 * @package    theme_elegance&lt;br /&gt;
 * @copyright  2019 Bas Brands&lt;br /&gt;
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
class core_renderer extends boost_core_renderer {&lt;br /&gt;
	 /**&lt;br /&gt;
     * Returns the title to use on the page.&lt;br /&gt;
     *&lt;br /&gt;
     * @since Moodle 2.5.1 2.6&lt;br /&gt;
     * @return string&lt;br /&gt;
     */&lt;br /&gt;
    public function page_title() {&lt;br /&gt;
        ...&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move your custom renderers or other overridden renderes to your themes classes/output folder too.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55634</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55634"/>
		<updated>2019-03-04T14:34:21Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Bootstrapbase uses Bootstrap version 2.3.3, Boost uses Bootstrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extension language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS uses a different css syntax than Sass. The most obvious difference is the way variables are defined; LESS uses @, Sass uses $. There are many other differences between LESS and Sass; [https://css-tricks.com/sass-vs-less/ css-tricks] has more information on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specify additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overridden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/bootstrapbase/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent and serve as an example.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialised in rendering custom widgets on the front page, so we only need to specify a different layout file for the front page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the front page.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
=== Migrating your LESS files ===&lt;br /&gt;
&lt;br /&gt;
The Bootstrapbase theme css is written in the [http://lesscss.org/ LESS css extention language]. Some child themes of bootstrapbase use LESS to generate their stylesheets. Usually these files are stored in the less/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The Boost theme css is written in the [https://sass-lang.com/ Sass css extention language]. A child theme can extend the Boost Sass files which are usually found in the sass/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The LESS and Sass extention languages are different and not compatible,  themes using less will have to migrate their stylesheets. This can be done manually or with the [https://www.npmjs.com/package/less2sass less2sass] tool to translate LESS files into Sass. This tool is a great start when migrating your LESS however, after running less2sass to migrate your stylesheets you will need to inspect them and fix them if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Icon styles */&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
@icon-big-width: 64px;&lt;br /&gt;
@icon-big-height: 64px;&lt;br /&gt;
&lt;br /&gt;
img.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: @icon-big-width;&lt;br /&gt;
        height: @icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.groupinfobox {&lt;br /&gt;
    .well;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example less from theme/bootstrapbase/less/moodle/core.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
$icon-big-width: 64px;&lt;br /&gt;
$icon-big-height: 64px;&lt;br /&gt;
.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: $icon-big-width;&lt;br /&gt;
        height: $icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 .groupinfobox {&lt;br /&gt;
    @extend .card;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example sass from theme/boost/scss/moodle_core.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extension language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
When you start migrating your LESS file a good starting point is your theme variables.less. Usually child themes define a number of new variables and override some of the variables defined in theme/bootstrapbase/less/bootstrap/variables.less.&lt;br /&gt;
Your new variables will probably be okay when migrating to SASS. The overridden bootstrap variables will no longer be valid. So for each overridden variable try to find the new variables name in theme/boost/sass/bootstrap/_variables.scss.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Scaffolding&lt;br /&gt;
// -------------------------&lt;br /&gt;
@bodyBackground:        @white;&lt;br /&gt;
@textColor:             @grayDark;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
// -------------------------&lt;br /&gt;
@linkColor:             #08c;&lt;br /&gt;
@linkColorHover:        darken(@linkColor, 15%);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables from theme/bootstrapbase/less/bootstrap/variables.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Body&lt;br /&gt;
//&lt;br /&gt;
// Settings for the `&amp;lt;body&amp;gt;` element.&lt;br /&gt;
&lt;br /&gt;
$body-bg:                   $white !default;&lt;br /&gt;
$body-color:                $gray-900 !default;&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
//&lt;br /&gt;
// Style anchor elements.&lt;br /&gt;
&lt;br /&gt;
$link-color:                theme-color(&amp;quot;primary&amp;quot;) !default;&lt;br /&gt;
$link-decoration:           none !default;&lt;br /&gt;
$link-hover-color:          darken($link-color, 15%) !default;&lt;br /&gt;
$link-hover-decoration:     underline !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables form theme/boost/sass/bootstrap/_variables.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Using grunt to debug Sass compile issues ===&lt;br /&gt;
&lt;br /&gt;
When you start creating your new Sass files debugging what happens in the Moodle core PHP Sass compiler can take a lot of time. The compiler is run using a caching mechanism and error reporting is poor, when a variable is misspelled the errors are send to your webserver logfiles.&lt;br /&gt;
&lt;br /&gt;
To speed up development The [http://gruntjs.com/ Grunt] Javascript taskrunner that runs on [https://nodejs.org/en/ Node.js] can be very helpful. If you have not tried to get Grunt running for Moodle core tasks make sure you read the [https://docs.moodle.org/dev/Grunt Moodle Grunt] docs page for more info.&lt;br /&gt;
&lt;br /&gt;
You can use Grunt to compile your Sass and check your Sass syntaxs. Once you have Grunt and Node.js up and running you can create your own Gruntfile.js and package.json file.&lt;br /&gt;
&lt;br /&gt;
For theme Elegance these files are found in [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/Gruntfile.js theme/elegance/Gruntfile.js] and [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/postcss.js theme/elegance/package.json].&lt;br /&gt;
&lt;br /&gt;
You can copy these into your theme folder and run the Node installer to retreive all Node dependancies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
&amp;gt; nmp install&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you update the Gruntfile.js to reflect your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    sass: {&lt;br /&gt;
        options: {&lt;br /&gt;
            style: &#039;expanded&#039;&lt;br /&gt;
        },&lt;br /&gt;
        dist: {&lt;br /&gt;
            files: {&lt;br /&gt;
                &#039;style/elegance.css&#039;: &#039;scss/gruntcompile.scss&#039;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of the Grunfile.js you will need to change&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once all dependancies are installed you can run Grunt to watch your Sass files. Each time you make a change in any of the files the the Node compiler will run and create a new stylesheet in your theme&#039;s style/ folder&lt;br /&gt;
&lt;br /&gt;
This stylesheet will not be served to the end user unless you change your theme configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = [&#039;elegance&#039;];&lt;br /&gt;
&lt;br /&gt;
// Commented out to prevent PHP Sass compiling.&lt;br /&gt;
//$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
//    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
//};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Migrating your renderer files ===&lt;br /&gt;
&lt;br /&gt;
In Bootstrapbase the overriden renderers were located in theme/boost/renderers/. These renderes are stored in classes/output in the Boost.&lt;br /&gt;
&lt;br /&gt;
In theme Boost the overridden core renderer is located in theme/boost/classes/output/core_renderer.php. If your theme overrides the core renderer (/lib/outputrenderers.php) make sure you override the Boost renderer (In Moodle version 3.6 and below).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// This file is part of the elegance theme for Moodle&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
namespace theme_elegance\output;&lt;br /&gt;
&lt;br /&gt;
use \theme_boost\output\core_renderer as boost_core_renderer;&lt;br /&gt;
use stdClass;&lt;br /&gt;
use theme_config;&lt;br /&gt;
&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Renderers to align Moodle&#039;s HTML with that expected by Bootstrap&lt;br /&gt;
 *&lt;br /&gt;
 * @package    theme_elegance&lt;br /&gt;
 * @copyright  2019 Bas Brands&lt;br /&gt;
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
class core_renderer extends boost_core_renderer {&lt;br /&gt;
	 /**&lt;br /&gt;
     * Returns the title to use on the page.&lt;br /&gt;
     *&lt;br /&gt;
     * @since Moodle 2.5.1 2.6&lt;br /&gt;
     * @return string&lt;br /&gt;
     */&lt;br /&gt;
    public function page_title() {&lt;br /&gt;
        ...&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move your custom renderers or other overridden renderes to your themes classes/output folder too.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55633</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55633"/>
		<updated>2019-03-04T13:55:02Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Using grunt to debug Sass compile issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Bootstrapbase uses Bootstrap version 2.3.3, Boost uses Bootstrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extension language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS uses a different css syntax than Sass. The most obvious difference is the way variables are defined; LESS uses @, Sass uses $. There are many other differences between LESS and Sass; [https://css-tricks.com/sass-vs-less/ css-tricks] has more information on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specify additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overridden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/bootstrapbase/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent and serve as an example.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialised in rendering custom widgets on the front page, so we only need to specify a different layout file for the front page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the front page.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
=== Migrating your LESS files ===&lt;br /&gt;
&lt;br /&gt;
The Bootstrapbase theme css is written in the [http://lesscss.org/ LESS css extention language]. Some child themes of bootstrapbase use LESS to generate their stylesheets. Usually these files are stored in the less/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The Boost theme css is written in the [https://sass-lang.com/ Sass css extention language]. A child theme can extend the Boost Sass files which are usually found in the sass/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The LESS and Sass extention languages are different and not compatible,  themes using less will have to migrate their stylesheets. This can be done manually or with the [https://www.npmjs.com/package/less2sass less2sass] tool to translate LESS files into Sass. This tool is a great start when migrating your LESS however, after running less2sass to migrate your stylesheets you will need to inspect them and fix them if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Icon styles */&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
@icon-big-width: 64px;&lt;br /&gt;
@icon-big-height: 64px;&lt;br /&gt;
&lt;br /&gt;
img.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: @icon-big-width;&lt;br /&gt;
        height: @icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.groupinfobox {&lt;br /&gt;
    .well;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example less from theme/bootstrapbase/less/moodle/core.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
$icon-big-width: 64px;&lt;br /&gt;
$icon-big-height: 64px;&lt;br /&gt;
.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: $icon-big-width;&lt;br /&gt;
        height: $icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 .groupinfobox {&lt;br /&gt;
    @extend .card;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example sass from theme/boost/scss/moodle_core.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extension language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
When you start migrating your LESS file a good starting point is your theme variables.less. Usually child themes define a number of new variables and override some of the variables defined in theme/bootstrapbase/less/bootstrap/variables.less.&lt;br /&gt;
Your new variables will probably be okay when migrating to SASS. The overridden bootstrap variables will no longer be valid. So for each overridden variable try to find the new variables name in theme/boost/sass/bootstrap/_variables.scss.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Scaffolding&lt;br /&gt;
// -------------------------&lt;br /&gt;
@bodyBackground:        @white;&lt;br /&gt;
@textColor:             @grayDark;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
// -------------------------&lt;br /&gt;
@linkColor:             #08c;&lt;br /&gt;
@linkColorHover:        darken(@linkColor, 15%);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables from theme/bootstrapbase/less/bootstrap/variables.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Body&lt;br /&gt;
//&lt;br /&gt;
// Settings for the `&amp;lt;body&amp;gt;` element.&lt;br /&gt;
&lt;br /&gt;
$body-bg:                   $white !default;&lt;br /&gt;
$body-color:                $gray-900 !default;&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
//&lt;br /&gt;
// Style anchor elements.&lt;br /&gt;
&lt;br /&gt;
$link-color:                theme-color(&amp;quot;primary&amp;quot;) !default;&lt;br /&gt;
$link-decoration:           none !default;&lt;br /&gt;
$link-hover-color:          darken($link-color, 15%) !default;&lt;br /&gt;
$link-hover-decoration:     underline !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables form theme/boost/sass/bootstrap/_variables.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Using Grunt to compile Sass ===&lt;br /&gt;
&lt;br /&gt;
When you start creating your new Sass files debugging what happens in the Moodle core PHP Sass compiler can take a lot of time. The compiler is run using a caching mechanism and error reporting is poor, when a variable is misspelled the errors are send to your webserver logfiles.&lt;br /&gt;
&lt;br /&gt;
To speed up development The [http://gruntjs.com/ Grunt] Javascript taskrunner that runs on [https://nodejs.org/en/ Node.js] can be very helpful. If you have not tried to get Grunt running for Moodle core tasks make sure you read the [https://docs.moodle.org/dev/Grunt Moodle Grunt] docs page for more info.&lt;br /&gt;
&lt;br /&gt;
You can use Grunt to compile your Sass and check your Sass syntaxs. Once you have Grunt and Node.js up and running you can create your own Gruntfile.js and package.json file.&lt;br /&gt;
&lt;br /&gt;
For theme Elegance these files are found in [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/Gruntfile.js theme/elegance/Gruntfile.js] and [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/postcss.js theme/elegance/package.json].&lt;br /&gt;
&lt;br /&gt;
You can copy these into your theme folder and run the Node installer to retreive all Node dependancies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
&amp;gt; nmp install&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you update the Gruntfile.js to reflect your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    sass: {&lt;br /&gt;
        options: {&lt;br /&gt;
            style: &#039;expanded&#039;&lt;br /&gt;
        },&lt;br /&gt;
        dist: {&lt;br /&gt;
            files: {&lt;br /&gt;
                &#039;style/elegance.css&#039;: &#039;scss/gruntcompile.scss&#039;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of the Grunfile.js you will need to change&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once all dependancies are installed you can run Grunt to watch your Sass files. Each time you make a change in any of the files the the Node compiler will run and create a new stylesheet in your theme&#039;s style/ folder&lt;br /&gt;
&lt;br /&gt;
This stylesheet will not be served to the end user unless you change your theme configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = [&#039;elegance&#039;];&lt;br /&gt;
&lt;br /&gt;
// Commented out to prevent PHP Sass compiling.&lt;br /&gt;
//$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
//    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
//};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of theme/elegance/config.php&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55632</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55632"/>
		<updated>2019-03-04T13:54:18Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Bootstrapbase uses Bootstrap version 2.3.3, Boost uses Bootstrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extension language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS uses a different css syntax than Sass. The most obvious difference is the way variables are defined; LESS uses @, Sass uses $. There are many other differences between LESS and Sass; [https://css-tricks.com/sass-vs-less/ css-tricks] has more information on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specify additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overridden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/bootstrapbase/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent and serve as an example.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialised in rendering custom widgets on the front page, so we only need to specify a different layout file for the front page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the front page.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
=== Migrating your LESS files ===&lt;br /&gt;
&lt;br /&gt;
The Bootstrapbase theme css is written in the [http://lesscss.org/ LESS css extention language]. Some child themes of bootstrapbase use LESS to generate their stylesheets. Usually these files are stored in the less/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The Boost theme css is written in the [https://sass-lang.com/ Sass css extention language]. A child theme can extend the Boost Sass files which are usually found in the sass/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The LESS and Sass extention languages are different and not compatible,  themes using less will have to migrate their stylesheets. This can be done manually or with the [https://www.npmjs.com/package/less2sass less2sass] tool to translate LESS files into Sass. This tool is a great start when migrating your LESS however, after running less2sass to migrate your stylesheets you will need to inspect them and fix them if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Icon styles */&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
@icon-big-width: 64px;&lt;br /&gt;
@icon-big-height: 64px;&lt;br /&gt;
&lt;br /&gt;
img.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: @icon-big-width;&lt;br /&gt;
        height: @icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.groupinfobox {&lt;br /&gt;
    .well;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example less from theme/bootstrapbase/less/moodle/core.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
$icon-big-width: 64px;&lt;br /&gt;
$icon-big-height: 64px;&lt;br /&gt;
.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: $icon-big-width;&lt;br /&gt;
        height: $icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 .groupinfobox {&lt;br /&gt;
    @extend .card;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example sass from theme/boost/scss/moodle_core.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extension language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
When you start migrating your LESS file a good starting point is your theme variables.less. Usually child themes define a number of new variables and override some of the variables defined in theme/bootstrapbase/less/bootstrap/variables.less.&lt;br /&gt;
Your new variables will probably be okay when migrating to SASS. The overridden bootstrap variables will no longer be valid. So for each overridden variable try to find the new variables name in theme/boost/sass/bootstrap/_variables.scss.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Scaffolding&lt;br /&gt;
// -------------------------&lt;br /&gt;
@bodyBackground:        @white;&lt;br /&gt;
@textColor:             @grayDark;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
// -------------------------&lt;br /&gt;
@linkColor:             #08c;&lt;br /&gt;
@linkColorHover:        darken(@linkColor, 15%);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables from theme/bootstrapbase/less/bootstrap/variables.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Body&lt;br /&gt;
//&lt;br /&gt;
// Settings for the `&amp;lt;body&amp;gt;` element.&lt;br /&gt;
&lt;br /&gt;
$body-bg:                   $white !default;&lt;br /&gt;
$body-color:                $gray-900 !default;&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
//&lt;br /&gt;
// Style anchor elements.&lt;br /&gt;
&lt;br /&gt;
$link-color:                theme-color(&amp;quot;primary&amp;quot;) !default;&lt;br /&gt;
$link-decoration:           none !default;&lt;br /&gt;
$link-hover-color:          darken($link-color, 15%) !default;&lt;br /&gt;
$link-hover-decoration:     underline !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables form theme/boost/sass/bootstrap/_variables.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Using grunt to debug Sass compile issues ===&lt;br /&gt;
&lt;br /&gt;
When you start creating your new Sass files debugging what happens in the Moodle core PHP Sass compiler can take a lot of time. The compiler is run using a caching mechanism and error reporting is poor, when a variable is misspelled the errors are send to your webserver logfiles.&lt;br /&gt;
&lt;br /&gt;
To speed up development The [http://gruntjs.com/ Grunt] Javascript taskrunner that runs on [https://nodejs.org/en/ Node.js] can be very helpful. If you have not tried to get Grunt running for Moodle core tasks make sure you read the [https://docs.moodle.org/dev/Grunt Moodle Grunt] docs page for more info.&lt;br /&gt;
&lt;br /&gt;
You can use Grunt to compile your Sass and check your Sass syntaxs. Once you have Grunt and Node.js up and running you can create your own Gruntfile.js and package.json file.&lt;br /&gt;
&lt;br /&gt;
For theme Elegance these files are found in [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/Gruntfile.js theme/elegance/Gruntfile.js] and [https://github.com/bmbrands/moodle-theme_elegance/blob/MOODLE_36_STABLE/postcss.js theme/elegance/package.json].&lt;br /&gt;
&lt;br /&gt;
You can copy these into your theme folder and run the Node installer to retreive all Node dependancies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
&amp;gt; nmp install&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you update the Gruntfile.js to reflect your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    sass: {&lt;br /&gt;
        options: {&lt;br /&gt;
            style: &#039;expanded&#039;&lt;br /&gt;
        },&lt;br /&gt;
        dist: {&lt;br /&gt;
            files: {&lt;br /&gt;
                &#039;style/elegance.css&#039;: &#039;scss/gruntcompile.scss&#039;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of the Grunfile.js you will need to change&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once all dependancies are installed you can run Grunt to watch your Sass files. Each time you make a change in any of the files the the Node compiler will run and create a new stylesheet in your theme&#039;s style/ folder&lt;br /&gt;
&lt;br /&gt;
This stylesheet will not be served to the end user unless you change your theme configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = [&#039;elegance&#039;];&lt;br /&gt;
&lt;br /&gt;
// Commented out to prevent PHP Sass compiling.&lt;br /&gt;
//$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
//    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
//};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;section of theme/elegance/config.php&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55627</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55627"/>
		<updated>2019-03-04T12:41:05Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Migrating your LESS files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Bootstrapbase uses Bootstrap version 2.3.3, Boost uses Bootstrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extension language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS uses a different css syntax than Sass. The most obvious difference is the way variables are defined; LESS uses @, Sass uses $. There are many other differences between LESS and Sass; [https://css-tricks.com/sass-vs-less/ css-tricks] has more information on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specify additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overridden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/bootstrapbase/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent and serve as an example.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialised in rendering custom widgets on the front page, so we only need to specify a different layout file for the front page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the front page.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
=== Migrating your LESS files ===&lt;br /&gt;
&lt;br /&gt;
The Bootstrapbase theme css is written in the [http://lesscss.org/ LESS css extention language]. Some child themes of bootstrapbase use LESS to generate their stylesheets. Usually these files are stored in the less/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The Boost theme css is written in the [https://sass-lang.com/ Sass css extention language]. A child theme can extend the Boost Sass files which are usually found in the sass/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The LESS and Sass extention languages are different and not compatible,  themes using less will have to migrate their stylesheets. This can be done manually or with the [https://www.npmjs.com/package/less2sass less2sass] tool to translate LESS files into Sass. This tool is a great start when migrating your LESS however, after running less2sass to migrate your stylesheets you will need to inspect them and fix them if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Icon styles */&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
@icon-big-width: 64px;&lt;br /&gt;
@icon-big-height: 64px;&lt;br /&gt;
&lt;br /&gt;
img.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: @icon-big-width;&lt;br /&gt;
        height: @icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.groupinfobox {&lt;br /&gt;
    .well;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example less from theme/bootstrapbase/less/moodle/core.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
$icon-big-width: 64px;&lt;br /&gt;
$icon-big-height: 64px;&lt;br /&gt;
.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: $icon-big-width;&lt;br /&gt;
        height: $icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 .groupinfobox {&lt;br /&gt;
    @extend .card;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example sass from theme/boost/scss/moodle_core.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extension language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
When you start migrating your LESS file a good starting point is your theme variables.less. Usually child themes define a number of new variables and override some of the variables defined in theme/bootstrapbase/less/bootstrap/variables.less.&lt;br /&gt;
Your new variables will probably be okay when migrating to SASS. The overridden bootstrap variables will no longer be valid. So for each overridden variable try to find the new variables name in theme/boost/sass/bootstrap/_variables.scss.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Scaffolding&lt;br /&gt;
// -------------------------&lt;br /&gt;
@bodyBackground:        @white;&lt;br /&gt;
@textColor:             @grayDark;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
// -------------------------&lt;br /&gt;
@linkColor:             #08c;&lt;br /&gt;
@linkColorHover:        darken(@linkColor, 15%);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables from theme/bootstrapbase/less/bootstrap/variables.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Body&lt;br /&gt;
//&lt;br /&gt;
// Settings for the `&amp;lt;body&amp;gt;` element.&lt;br /&gt;
&lt;br /&gt;
$body-bg:                   $white !default;&lt;br /&gt;
$body-color:                $gray-900 !default;&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
//&lt;br /&gt;
// Style anchor elements.&lt;br /&gt;
&lt;br /&gt;
$link-color:                theme-color(&amp;quot;primary&amp;quot;) !default;&lt;br /&gt;
$link-decoration:           none !default;&lt;br /&gt;
$link-hover-color:          darken($link-color, 15%) !default;&lt;br /&gt;
$link-hover-decoration:     underline !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables form theme/boost/sass/bootstrap/_variables.scss&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55626</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55626"/>
		<updated>2019-03-04T12:39:58Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Migrating your LESS files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Bootstrapbase uses Bootstrap version 2.3.3, Boost uses Bootstrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extension language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS uses a different css syntax than Sass. The most obvious difference is the way variables are defined; LESS uses @, Sass uses $. There are many other differences between LESS and Sass; [https://css-tricks.com/sass-vs-less/ css-tricks] has more information on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specify additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overridden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/bootstrapbase/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent and serve as an example.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialised in rendering custom widgets on the front page, so we only need to specify a different layout file for the front page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the front page.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
== Migrating your LESS files ==&lt;br /&gt;
&lt;br /&gt;
The Bootstrapbase theme css is written in the [http://lesscss.org/ LESS css extention language]. Some child themes of bootstrapbase use LESS to generate their stylesheets. Usually these files are stored in the less/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The Boost theme css is written in the [https://sass-lang.com/ Sass css extention language]. A child theme can extend the Boost Sass files which are usually found in the sass/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The LESS and Sass extention languages are different and not compatible,  themes using less will have to migrate their stylesheets. This can be done manually or with the [https://www.npmjs.com/package/less2sass less2sass] tool to translate LESS files into Sass. This tool is a great start when migrating your LESS however, after running less2sass to migrate your stylesheets you will need to inspect them and fix them if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Icon styles */&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
@icon-big-width: 64px;&lt;br /&gt;
@icon-big-height: 64px;&lt;br /&gt;
&lt;br /&gt;
img.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: @icon-big-width;&lt;br /&gt;
        height: @icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.groupinfobox {&lt;br /&gt;
    .well;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example less from theme/bootstrapbase/less/moodle/core.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
$icon-big-width: 64px;&lt;br /&gt;
$icon-big-height: 64px;&lt;br /&gt;
.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: $icon-big-width;&lt;br /&gt;
        height: $icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 .groupinfobox {&lt;br /&gt;
    @extend .card;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example sass from theme/boost/scss/moodle_core.scss&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extension language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
When you start migrating your LESS file a good starting point is your theme variables.less. Usually child themes define a number of new variables and override some of the variables defined in theme/bootstrapbase/less/bootstrap/variables.less.&lt;br /&gt;
Your new variables will probably be okay when migrating to SASS. The overridden bootstrap variables will no longer be valid. So for each overridden variable try to find the new variables name in theme/boost/sass/bootstrap/_variables.scss.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Scaffolding&lt;br /&gt;
// -------------------------&lt;br /&gt;
@bodyBackground:        @white;&lt;br /&gt;
@textColor:             @grayDark;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
// -------------------------&lt;br /&gt;
@linkColor:             #08c;&lt;br /&gt;
@linkColorHover:        darken(@linkColor, 15%);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables from theme/bootstrapbase/less/bootstrap/variables.less&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Body&lt;br /&gt;
//&lt;br /&gt;
// Settings for the `&amp;lt;body&amp;gt;` element.&lt;br /&gt;
&lt;br /&gt;
$body-bg:                   $white !default;&lt;br /&gt;
$body-color:                $gray-900 !default;&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
//&lt;br /&gt;
// Style anchor elements.&lt;br /&gt;
&lt;br /&gt;
$link-color:                theme-color(&amp;quot;primary&amp;quot;) !default;&lt;br /&gt;
$link-decoration:           none !default;&lt;br /&gt;
$link-hover-color:          darken($link-color, 15%) !default;&lt;br /&gt;
$link-hover-decoration:     underline !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;example variables form theme/boost/sass/bootstrap/_variables.scss&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55625</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55625"/>
		<updated>2019-03-04T12:38:39Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Migrating your LESS files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Bootstrapbase uses Bootstrap version 2.3.3, Boost uses Bootstrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extension language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS uses a different css syntax than Sass. The most obvious difference is the way variables are defined; LESS uses @, Sass uses $. There are many other differences between LESS and Sass; [https://css-tricks.com/sass-vs-less/ css-tricks] has more information on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specify additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overridden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/bootstrapbase/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent and serve as an example.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialised in rendering custom widgets on the front page, so we only need to specify a different layout file for the front page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the front page.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
== Migrating your LESS files ==&lt;br /&gt;
&lt;br /&gt;
The Bootstrapbase theme css is written in the [http://lesscss.org/ LESS css extention language]. Some child themes of bootstrapbase use LESS to generate their stylesheets. Usually these files are stored in the less/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The Boost theme css is written in the [https://sass-lang.com/ Sass css extention language]. A child theme can extend the Boost Sass files which are usually found in the sass/ folder of the child theme.&lt;br /&gt;
&lt;br /&gt;
The LESS and Sass extention languages are different and not compatible,  themes using less will have to migrate their stylesheets. This can be done manually or with the [https://www.npmjs.com/package/less2sass less2sass] tool to translate LESS files into Sass. This tool is a great start when migrating your LESS however, after running less2sass to migrate your stylesheets you will need to inspect them and fix them if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/* Icon styles */&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
@icon-big-width: 64px;&lt;br /&gt;
@icon-big-height: 64px;&lt;br /&gt;
&lt;br /&gt;
img.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: @icon-big-width;&lt;br /&gt;
        height: @icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.groupinfobox {&lt;br /&gt;
    .well;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
_example less from theme/bootstrapbase/less/moodle/core.less_&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Size of big icons.&lt;br /&gt;
$icon-big-width: 64px;&lt;br /&gt;
$icon-big-height: 64px;&lt;br /&gt;
.icon {&lt;br /&gt;
    &amp;amp;.iconsize-big {&lt;br /&gt;
        width: $icon-big-width;&lt;br /&gt;
        height: $icon-big-height;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 .groupinfobox {&lt;br /&gt;
    @extend .card;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
_example sass from theme/boost/scss/moodle_core.scss_&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extension language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
When you start migrating your LESS file a good starting point is your theme variables.less. Usually child themes define a number of new variables and override some of the variables defined in theme/bootstrapbase/less/bootstrap/variables.less.&lt;br /&gt;
Your new variables will probably be okay when migrating to SASS. The overridden bootstrap variables will no longer be valid. So for each overridden variable try to find the new variables name in theme/boost/sass/bootstrap/_variables.scss.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Scaffolding&lt;br /&gt;
// -------------------------&lt;br /&gt;
@bodyBackground:        @white;&lt;br /&gt;
@textColor:             @grayDark;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
// -------------------------&lt;br /&gt;
@linkColor:             #08c;&lt;br /&gt;
@linkColorHover:        darken(@linkColor, 15%);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
_example variables from theme/bootstrapbase/less/bootstrap/variables.less_&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
// Body&lt;br /&gt;
//&lt;br /&gt;
// Settings for the `&amp;lt;body&amp;gt;` element.&lt;br /&gt;
&lt;br /&gt;
$body-bg:                   $white !default;&lt;br /&gt;
$body-color:                $gray-900 !default;&lt;br /&gt;
&lt;br /&gt;
// Links&lt;br /&gt;
//&lt;br /&gt;
// Style anchor elements.&lt;br /&gt;
&lt;br /&gt;
$link-color:                theme-color(&amp;quot;primary&amp;quot;) !default;&lt;br /&gt;
$link-decoration:           none !default;&lt;br /&gt;
$link-hover-color:          darken($link-color, 15%) !default;&lt;br /&gt;
$link-hover-decoration:     underline !default;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
_example variables form theme/boost/sass/bootstrap/_variables.scss_&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55618</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55618"/>
		<updated>2019-03-01T07:09:26Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Renderers differences */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Bootstrapbase uses Bootstrap version 2.3.3, Boost uses Bootstrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extension language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS uses a different css syntax than Sass. The most obvious difference is the way variables are defined; LESS uses @, Sass uses $. There are many other differences between LESS and Sass; [https://css-tricks.com/sass-vs-less/ css-tricks] has more information on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specify additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overridden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/bootstrapbase/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent and serve as an example.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialised in rendering custom widgets on the front page, so we only need to specify a different layout file for the front page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the front page.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
== Migrating your LESS files ==&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extension language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
Less files can be translated with [https://www.npmjs.com/package/less2sass less2sass]. Once you have translated your less files to SASS syntax you will need to inspect them to see if they still make sense.&lt;br /&gt;
&lt;br /&gt;
If you have created the files scss/variables.scss and scss/post.scss you can used these files to include your translated sass files.&lt;br /&gt;
&lt;br /&gt;
Copy paste variables into scss/variables.scss Include your translated files in scss/post.scss&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55615</id>
		<title>Moving your theme to use boost as a parent theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moving_your_theme_to_use_boost_as_a_parent_theme&amp;diff=55615"/>
		<updated>2019-02-28T16:42:38Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: Created page with &amp;quot;== Key differences ==  === Bootstrap version differences ===  The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key differences ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap version differences ===&lt;br /&gt;
&lt;br /&gt;
The biggest difference between themes Bootstrapbase and Boost are the included [http://getbootstrap.com Bootstrap] libraries. Boostrapbase uses Bootstrap version 2.3.3, Boost uses Boostrap version 4.0.0 (at the time of writing this document).&lt;br /&gt;
&lt;br /&gt;
=== CSS extention language differences ===&lt;br /&gt;
&lt;br /&gt;
[http://lesscss.org/ LESS css] is used in Bootstrapbase, Boost uses [https://sass-lang.com/ Sass CSS].&lt;br /&gt;
&lt;br /&gt;
LESS css uses a different syntaxt from Sass css and, the easiest difference to spot is the way variables are defined; LESS uses @, Sass uses $. There are much differences between LESS and Sass [https://css-tricks.com/sass-vs-less/ css-tricks] has lots of info on these differences. The npm package [https://www.npmjs.com/package/less2sass less2sass] can be helpful when migrating your less files.&lt;br /&gt;
&lt;br /&gt;
LESS css is compiled using a core [https://docs.moodle.org/dev/Grunt grunt] task and stored in theme/bootstrapbase/style/moodle.css. Child themes need to specifiy additional stylesheets using the &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = []&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
array or use &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to use the core [https://github.com/oyejorge/LESS.php LESScss] library&lt;br /&gt;
&lt;br /&gt;
Sass css is compiled using a core [http://leafo.github.io/scssphp scssphp] Library for theme Boost and child themes if &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = &#039;&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
is used. The compiled css file served to the end user is stored in a Moodle cache and is regenerated each time theme caches are cleared. Using the core scssphp compiler allows for the usage of [https://docs.moodle.org/dev/Boost_Presets Boost Presets]. For information on advanced usage of Sass css see the [https://docs.moodle.org/dev/SCSS SCSS] doc page.&lt;br /&gt;
&lt;br /&gt;
=== Moodle templates differences ===&lt;br /&gt;
&lt;br /&gt;
Theme Boost uses [https://docs.moodle.org/dev/Templates Templates] to render the main layouts. For each of the layout files in theme/boost/layouts/ there is a corresponding layout file in theme/boost/templates.&lt;br /&gt;
&lt;br /&gt;
The layout files found in theme Bootstrapbase are a combination of php and html.&lt;br /&gt;
&lt;br /&gt;
=== Renderers differences ===&lt;br /&gt;
&lt;br /&gt;
In theme Boost all overriden renderers can be found theme/boost/classes/output, in theme Bootstrapbase the overridden renderers are called in /theme/boost/renderers.php.&lt;br /&gt;
&lt;br /&gt;
=== Theme config differences ===&lt;br /&gt;
&lt;br /&gt;
The theme configuration for Boost based themes do not differ much from Bootstrapbase based themes. For a full list of option is available in the [https://docs.moodle.org/dev/Themes_overview#Appendix_A Themes Overview] doc page.&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Bootstrapbase and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;lessfile = &#039;moodle&#039;;&lt;br /&gt;
$THEME-&amp;gt;lessvariablescallback = &#039;theme_more_less_variables&#039;;&lt;br /&gt;
$THEME-&amp;gt;extralesscallback = &#039;theme_more_extra_less&#039;;&lt;br /&gt;
$THEME-&amp;gt;doctype = &#039;html5&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These configuration options only apply to theme Boost and child themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;precompiledcsscallback = &#039;theme_boost_get_precompiled_css&#039;;&lt;br /&gt;
$THEME-&amp;gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading a theme to use Boost as a parent theme. ==&lt;br /&gt;
&lt;br /&gt;
There is no fit-for-all tutorial on upgrading your theme since themes can have lost of custom features. The steps specified here are the steps that were taken upgrading the community theme [https://moodle.org/plugins/theme_elegance Elegance] to use theme Boost as its parent.&lt;br /&gt;
&lt;br /&gt;
=== Update the theme config ===&lt;br /&gt;
&lt;br /&gt;
Most of the config file can remain the same. References to less files need to be removed, the theme scss content needs to be specified using a callback .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_elegance_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this example the theme was specialized in rendering custom widgets on the frontpage, so we only need to specify a different layout file for the frontpage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts[&#039;frontpage&#039;] = [&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; [&#039;side-pre&#039;],&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; [&#039;nonavbar&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/config.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Update the theme lib file ===&lt;br /&gt;
&lt;br /&gt;
Add the get_main_scss_content callback function to your theme lib file.&lt;br /&gt;
&lt;br /&gt;
The callback function will need to fetch the Sass files from your parent theme. Use this example when basing your theme of Boost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Returns the main SCSS content.&lt;br /&gt;
 *&lt;br /&gt;
 * @param theme_config $theme The theme config object.&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function theme_elegance_get_main_scss_content($theme) {&lt;br /&gt;
    global $CFG;&lt;br /&gt;
&lt;br /&gt;
    $scss = file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/variables.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/fontawesome.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/bootstrap.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/boost/scss/moodle.scss&#039;);&lt;br /&gt;
    $scss .= file_get_contents($CFG-&amp;gt;dirroot . &#039;/theme/elegance/scss/post.scss&#039;);&lt;br /&gt;
&lt;br /&gt;
    return $scss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/lib.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure your create these files when using the example above:&lt;br /&gt;
&lt;br /&gt;
* theme/elegance/scss/variables.scss&lt;br /&gt;
* theme/elegance/scss/post.scss&lt;br /&gt;
&lt;br /&gt;
=== Create your template and layout files ===&lt;br /&gt;
&lt;br /&gt;
If your theme contains custom layouts it will need a template for each layout. &lt;br /&gt;
&lt;br /&gt;
For theme elegance these layout files and templates were copied&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cp theme/boost/layout/columns2.php theme/elegance/layout/frontpage.php&lt;br /&gt;
cp theme/boost/templates/columns2.mustache theme/elegance/templates/layout_frontpage.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in the new frontpage.php the reference to the template needs updating after copying these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_elegance/layout_frontpage&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now the layout file and the template file are in place custom widget / renderers can be added for the frontpage.&lt;br /&gt;
&lt;br /&gt;
For theme elegance a carousel slideshow can be configured through the theme settings. The renderer for this carousel is called in theme/elegance/layout/frontpage.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$renderer = $PAGE-&amp;gt;get_renderer(&#039;theme_elegance&#039;);&lt;br /&gt;
$carousel = new \theme_elegance\output\carousel();&lt;br /&gt;
$widgets = (object) [&lt;br /&gt;
    &#039;carousel&#039; =&amp;gt; $renderer-&amp;gt;render($carousel)&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
    ..&lt;br /&gt;
    &#039;widgets&#039; =&amp;gt; $widgets,&lt;br /&gt;
    ..&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;code snippet from theme/elegance/layout/frontpage.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The carousel widget is passed on to the theme/elegance/template/layout_frontpage.mustache template&lt;br /&gt;
&lt;br /&gt;
== migrating your LESS files ==&lt;br /&gt;
&lt;br /&gt;
The [https://sass-lang.com/ Sass CSS] extention language is not that hard to learn. Make sure you have read [https://sass-lang.com/guide The Sass Basics] and understand how to define and override variables and use mixins.&lt;br /&gt;
&lt;br /&gt;
Less files can be translated with [https://www.npmjs.com/package/less2sass less2sass]. Once you have transated your less files to SASS syntax you will need to inspect them to see if they still make sense.&lt;br /&gt;
&lt;br /&gt;
If you have created the files scss/variables.scss and scss/post.scss you can used these files to include your translated sass files.&lt;br /&gt;
&lt;br /&gt;
Copy paste variables into scss/variables.scss Include your translated files in scss/post.scss&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Themes&amp;diff=55614</id>
		<title>Themes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Themes&amp;diff=55614"/>
		<updated>2019-02-28T16:11:06Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a starting point for Moodle theme developers.&lt;br /&gt;
&lt;br /&gt;
For documentation on installing and using themes, please see the [[:en:Themes|Themes user documentation]] and [[:en:Themes FAQ|Themes FAQ]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Moodle has a powerful themes system that allows for a variety of effects through the use of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
* [[Themes overview]]&lt;br /&gt;
* [[Creating a theme based on boost]]&lt;br /&gt;
* [[Moving your theme to use boost as a parent theme]]&lt;br /&gt;
* [[Updating a boost based theme]]&lt;br /&gt;
* [[Using images in a theme|Using images]]&lt;br /&gt;
* [[Creating a theme settings page|Theme settings page]]&lt;br /&gt;
* [[Adding theme upgrade code]]&lt;br /&gt;
* [[Extending the theme custom menu|Extending the custom menu]]&lt;br /&gt;
* [[Overriding a renderer]]&lt;br /&gt;
* [[Theme checklist]]&lt;br /&gt;
* [[Templates]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Themes|List of all themes-related developer documentation]]&lt;br /&gt;
* [http://youtu.be/K3MYE8am7M4 Install a New Theme]  MoodleBites video on YouTube &lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Upgrading_themes_to_Moodle_3.6&amp;diff=55268</id>
		<title>Upgrading themes to Moodle 3.6</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Upgrading_themes_to_Moodle_3.6&amp;diff=55268"/>
		<updated>2018-12-13T11:16:21Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: Created page with &amp;quot;{{Moodle 3.2}} {{Template:Themes}}  Moodle 3.6 adds a few new features that effects child themes, the new messaging user interface requires a renderer callback to load the mes...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 3.2}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
Moodle 3.6 adds a few new features that effects child themes, the new messaging user interface requires a renderer callback to load the message drawer. This can affect boost and bootstrap base child themes.&lt;br /&gt;
&lt;br /&gt;
== Boost based child themes ==&lt;br /&gt;
&lt;br /&gt;
If your child theme overrides one of these Boost layout files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
templates/columns1.mustache&lt;br /&gt;
templates/columns2.mustache&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to add this callback to your custom layout file: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
{{{ output.standard_after_main_region_html }}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You custom layout file might define its own main content region, adding the renderer callback after this region should make it work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page&amp;quot; class=&amp;quot;container-fluid&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{{ output.standard_after_main_region_html }}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
If your theme defines its own layout files, make sure the callback is added there too. The callback should not be added to layout files for login, maintenance or the secure.mustache layout.&lt;br /&gt;
&lt;br /&gt;
== Bootstrapbase based child themes ==&lt;br /&gt;
&lt;br /&gt;
If your child theme overrides one of these layout files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
layout/columns1.php&lt;br /&gt;
layout/columns2.php&lt;br /&gt;
layout/columns3.php&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to add this callback to your custom layout file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_after_main_region_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You custom layout file might define its own main content region, adding the renderer callback after this region should make it work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page-content&amp;quot; class=&amp;quot;row-fluid&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_after_main_region_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your theme defines its own layout files, make sure the callback is added there too. The callback should not be added to layout files for embedded, maintenance, popup or the secure.php layout.&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54432</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54432"/>
		<updated>2018-06-22T08:53:08Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Commonly used utility classes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. Most Boost child themes will need some updates for Moodle 3.5, this document has been written to help you understand what has been changed. And keep in mind, after your theme has been updated you will have access to the full range of Bootstrap 4 components and utilities which allow you to create amazing designs and layouts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;If you were using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] for styling the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in Boost presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [https://popper.js.org Popper] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [https://getbootstrap.com/docs/4.0/utilities/spacing/ Bootstrap spacing utilities] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [https://getbootstrap.com/docs/4.0/migration/#utilities Bootstrap utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [https://getbootstrap.com/docs/4.0/utilities/borders/ utility/helper classes] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54431</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54431"/>
		<updated>2018-06-22T08:52:30Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Bootstrap utility classes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. Most Boost child themes will need some updates for Moodle 3.5, this document has been written to help you understand what has been changed. And keep in mind, after your theme has been updated you will have access to the full range of Bootstrap 4 components and utilities which allow you to create amazing designs and layouts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;If you were using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] for styling the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in Boost presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [https://popper.js.org Popper] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [https://getbootstrap.com/docs/4.0/utilities/spacing/ Bootstrap spacing utilities] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [https://getbootstrap.com/docs/4.0/migration/#utilities Bootstrap utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54430</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54430"/>
		<updated>2018-06-22T08:50:38Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* JavaScript */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. Most Boost child themes will need some updates for Moodle 3.5, this document has been written to help you understand what has been changed. And keep in mind, after your theme has been updated you will have access to the full range of Bootstrap 4 components and utilities which allow you to create amazing designs and layouts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;If you were using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] for styling the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in Boost presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [https://popper.js.org Popper] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54420</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54420"/>
		<updated>2018-06-19T09:36:09Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. Most Boost child themes will need some updates for Moodle 3.5, this document has been written to help you understand what has been changed. And keep in mind, after your theme has been updated you will have access to the full range of Bootstrap 4 components and utilities which allow you to create amazing designs and layouts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;If you were using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] for styling the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in Boost presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54419</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54419"/>
		<updated>2018-06-19T09:27:36Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. Most Boost child themes will need some updates for Moodle 3.5, this document has been written to help you understand what has been changed. And keep in mind, after your theme has been updated you will have access to the full range of Bootstrap 4 components and utilities which allow you to create amazing designs and layouts.&lt;br /&gt;
&lt;br /&gt;
If you were using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] for styling the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in Boost presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54418</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54418"/>
		<updated>2018-06-19T09:21:08Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Changes in presets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways. &lt;br /&gt;
&lt;br /&gt;
If you are using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] for styling the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache.&lt;br /&gt;
&lt;br /&gt;
== Changes in Boost presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54417</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54417"/>
		<updated>2018-06-19T09:20:47Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways. &lt;br /&gt;
&lt;br /&gt;
If you are using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] for styling the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache.&lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54416</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54416"/>
		<updated>2018-06-19T09:19:34Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Commonly used utility classes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [https://getbootstrap.com/docs/4.0/utilities/colors/ color] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54415</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54415"/>
		<updated>2018-06-19T09:19:09Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Changed templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54414</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54414"/>
		<updated>2018-06-19T09:18:32Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Changed templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. &lt;br /&gt;
The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. &lt;br /&gt;
Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54413</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54413"/>
		<updated>2018-06-19T09:18:01Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Changed templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache. &lt;br /&gt;
The navbar color is styled using &amp;lt;code&amp;gt;navbar-light bg-white&amp;lt;/code&amp;gt; css classes. Changing the navbar color works best when copying the navbar.mustache theme into your Boost child theme. &lt;br /&gt;
Simply copy the template into this folder structure in your theme:&lt;br /&gt;
&amp;lt;code&amp;gt;/templates/theme_boost/navbar.mustache&amp;lt;/code&amp;gt;&lt;br /&gt;
And modify the mustache template to use &amp;lt;code&amp;gt;navbar-dark bg-primary&amp;lt;/code&amp;gt; or any other background color.&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown, this used to be the page navbar.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54412</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54412"/>
		<updated>2018-06-19T09:05:55Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a [https://docs.moodle.org/dev/Boost_Presets Boost preset] the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54411</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54411"/>
		<updated>2018-06-19T09:05:05Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Changes in Bootstrap */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a Moodle preset the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Most of these changes are documented in the [https://getbootstrap.com/docs/4.0/migration/ Bootstrap migration doc]. The changes that affect Moodle the most are listed below.&lt;br /&gt;
&lt;br /&gt;
=== Flexbox ===&lt;br /&gt;
Bootstrap Layouts have switched to [https://getbootstrap.com/docs/4.0/utilities/flex/ Flexbox] display utilities. Flexbox is used in many places in Bootstrap including forms, grids and cards.  Flexbox layout allows themers to have more control over the positioning of elements in a row or a column. A nice example of the power of Flexbox is the Bootstrap [https://getbootstrap.com/docs/4.1/components/card/#card-decks card decks]. &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript. Bootstrap dropdowns, popovers and tooltips also depend on the [Popper|https://popper.js.org] library which has been added as a Moodle core library. Upstream Bootstrap JavaScript has been reformatted into AMD using the Babel.js library. For more info see the Boost readme_moodle.txt.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss]. For more info on using these variables read the [https://getbootstrap.com/docs/4.1/getting-started/theming/ Bootstrap theming] doc and the [https://docs.moodle.org/dev/Boost_Presets Boost presets] doc.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
Utility classes can be used to modify web page elements  without needing to make any CSS changes. Bootstrap provides a wide range of utility classes ready to use when writing your HTML. These classes are widely used in Moodle templates and renderers. With the upgrade to Bootstrap 4 stable the classnames for spacing have changed. &lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;quot;old&amp;quot; style utilities are still available in Boost and are provided by [https://github.com/moodle/moodle/blob/master/theme/boost/scss/moodle/bs4alphacompat.scss bs4alphacompat.scss].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page. &lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54409</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54409"/>
		<updated>2018-06-19T08:25:50Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Changes in presets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a Moodle preset the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has been split into 3 separate imports&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Changes that affect Moodle most are:&lt;br /&gt;
&lt;br /&gt;
=== Flex ===&lt;br /&gt;
Switch to using [flex|https://getbootstrap.com/docs/4.0/utilities/flex/] positioning. Flexbox css properties are used in many places in Bootstrap including form fields, grids and cards.  Using the Bootstrap flex utility classes allow theme developer to have more control over the alignment of elements in a grid.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript, this includes using the [Popper|https://popper.js.org] library for positioning Modals and Tooltips.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in theme/boost/scss/moodle/bs4alphacompat.scss.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page&lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54408</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54408"/>
		<updated>2018-06-19T08:25:12Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Changes in presets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a Moodle preset the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [https://docs.moodle.org/dev/Boost_Presets Boost presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has now been split into 3 separate files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Changes that affect Moodle most are:&lt;br /&gt;
&lt;br /&gt;
=== Flex ===&lt;br /&gt;
Switch to using [flex|https://getbootstrap.com/docs/4.0/utilities/flex/] positioning. Flexbox css properties are used in many places in Bootstrap including form fields, grids and cards.  Using the Bootstrap flex utility classes allow theme developer to have more control over the alignment of elements in a grid.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript, this includes using the [Popper|https://popper.js.org] library for positioning Modals and Tooltips.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in theme/boost/scss/moodle/bs4alphacompat.scss.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page&lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54407</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54407"/>
		<updated>2018-06-19T08:23:26Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [https://getbootstrap.com/docs/4.0/getting-started/introduction/ Bootstrap 4] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a Moodle preset the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [Boost presets|https://docs.moodle.org/dev/Boost_Presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has now been split into 3 separate files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Changes that affect Moodle most are:&lt;br /&gt;
&lt;br /&gt;
=== Flex ===&lt;br /&gt;
Switch to using [flex|https://getbootstrap.com/docs/4.0/utilities/flex/] positioning. Flexbox css properties are used in many places in Bootstrap including form fields, grids and cards.  Using the Bootstrap flex utility classes allow theme developer to have more control over the alignment of elements in a grid.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript, this includes using the [Popper|https://popper.js.org] library for positioning Modals and Tooltips.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in theme/boost/scss/moodle/bs4alphacompat.scss.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page&lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54404</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54404"/>
		<updated>2018-06-18T15:25:30Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Flex */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [Bootstrap 4|https://getbootstrap.com/docs/4.0/getting-started/introduction/] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a Moodle preset the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [Boost presets|https://docs.moodle.org/dev/Boost_Presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has now been split into 3 separate files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Changes that affect Moodle most are:&lt;br /&gt;
&lt;br /&gt;
=== Flex ===&lt;br /&gt;
Switch to using [flex|https://getbootstrap.com/docs/4.0/utilities/flex/] positioning. Flexbox css properties are used in many places in Bootstrap including form fields, grids and cards.  Using the Bootstrap flex utility classes allow theme developer to have more control over the alignment of elements in a grid.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript, this includes using the [Popper|https://popper.js.org] library for positioning Modals and Tooltips.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in theme/boost/scss/moodle/bs4alphacompat.scss.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page&lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54403</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54403"/>
		<updated>2018-06-18T15:20:39Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [Bootstrap 4|https://getbootstrap.com/docs/4.0/getting-started/introduction/] libraries. This affects Boost child themes in a number of ways.&lt;br /&gt;
&lt;br /&gt;
If you are using a Moodle preset the preset file will need some updates, see the changes in presets section below. Without these changes your Moodle install will break.&lt;br /&gt;
&lt;br /&gt;
If your theme uses custom mustache templates or templates copied from Boost carefully compare your templates to the Moodle 3.5 boost templates. Especially the template columns2.mustach and the included navbar.mustache. &lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [Boost presets|https://docs.moodle.org/dev/Boost_Presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has now been split into 3 separate files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Changes that affect Moodle most are:&lt;br /&gt;
&lt;br /&gt;
=== Flex ===&lt;br /&gt;
# Switch to using [flex|https://getbootstrap.com/docs/4.0/utilities/flex/] positioning. This is used a lot in grids and form elements.&lt;br /&gt;
Changes in variable names&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript, this includes using the [Popper|https://popper.js.org] library for positioning Modals and Tooltips.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in theme/boost/scss/moodle/bs4alphacompat.scss.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page&lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54402</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54402"/>
		<updated>2018-06-18T14:30:14Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Changed templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [Bootstrap 4|https://getbootstrap.com/docs/4.0/getting-started/introduction/] libraries. This affects Boost child themes in a number of ways:&lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [Boost presets|https://docs.moodle.org/dev/Boost_Presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has now been split into 3 separate files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Changes that affect Moodle most are:&lt;br /&gt;
&lt;br /&gt;
=== Flex ===&lt;br /&gt;
# Switch to using [flex|https://getbootstrap.com/docs/4.0/utilities/flex/] positioning. This is used a lot in grids and form elements.&lt;br /&gt;
Changes in variable names&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript, this includes using the [Popper|https://popper.js.org] library for positioning Modals and Tooltips.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in theme/boost/scss/moodle/bs4alphacompat.scss.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page&lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the area for the page, the page breadcrumb and the section navigation dropdown.&lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/footer.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page footer included in the main mustache template columns2.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54401</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54401"/>
		<updated>2018-06-18T14:27:39Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Changed templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [Bootstrap 4|https://getbootstrap.com/docs/4.0/getting-started/introduction/] libraries. This affects Boost child themes in a number of ways:&lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [Boost presets|https://docs.moodle.org/dev/Boost_Presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has now been split into 3 separate files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Changes that affect Moodle most are:&lt;br /&gt;
&lt;br /&gt;
=== Flex ===&lt;br /&gt;
# Switch to using [flex|https://getbootstrap.com/docs/4.0/utilities/flex/] positioning. This is used a lot in grids and form elements.&lt;br /&gt;
Changes in variable names&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript, this includes using the [Popper|https://popper.js.org] library for positioning Modals and Tooltips.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in theme/boost/scss/moodle/bs4alphacompat.scss.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page&lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/head.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the page header: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;head&amp;gt;...&lt;br /&gt;
    &amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
New template: &amp;lt;b&amp;gt;theme/boost/templates/navbar.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed template: &amp;lt;b&amp;gt;theme/boost/templates/header.mustache&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54400</id>
		<title>Updating a boost based theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Updating_a_boost_based_theme&amp;diff=54400"/>
		<updated>2018-06-18T14:25:33Z</updated>

		<summary type="html">&lt;p&gt;Basbrands: /* Template updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Boost theme for Moodle 3.5 has been upgraded to use the upstream [Bootstrap 4|https://getbootstrap.com/docs/4.0/getting-started/introduction/] libraries. This affects Boost child themes in a number of ways:&lt;br /&gt;
&lt;br /&gt;
== Changes in presets ==&lt;br /&gt;
&lt;br /&gt;
The structure of [Boost presets|https://docs.moodle.org/dev/Boost_Presets] have changed, In versions up to Moodle 3.4 all Sass files were included using one single line for importing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The import has now been split into 3 separate files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
// Import FontAwesome.&lt;br /&gt;
@import &amp;quot;fontawesome&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import All of Bootstrap.&lt;br /&gt;
@import &amp;quot;bootstrap&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Import Core moodle CSS.&lt;br /&gt;
@import &amp;quot;moodle&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes in Bootstrap ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 Stable includes major changes compared to the Bootstrap 4 Alpha library used in Boost for Moodle 3.4 and older releases. Changes that affect Moodle most are:&lt;br /&gt;
&lt;br /&gt;
=== Flex ===&lt;br /&gt;
# Switch to using [flex|https://getbootstrap.com/docs/4.0/utilities/flex/] positioning. This is used a lot in grids and form elements.&lt;br /&gt;
Changes in variable names&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
The Boost javascript has been updated to use the 4.0 Bootstrap JavaScript, this includes using the [Popper|https://popper.js.org] library for positioning Modals and Tooltips.&lt;br /&gt;
&lt;br /&gt;
=== Sass variables ===&lt;br /&gt;
A number of SASS variables are no longer available in Bootstrap 4 Stable. Some of these variables were widely used in Core SASS and potentially in child themes. Some examples of these are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$font-size-root&lt;br /&gt;
$brand-primary&lt;br /&gt;
$spacer&lt;br /&gt;
$gray-dark&lt;br /&gt;
$state-success-text&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables and some utility classes used in Core SASS and HTML can still be used because of the Bootstrap 4 compatibility SASS file in theme/boost/scss/moodle/bs4alphacompat.scss.&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap utility classes ===&lt;br /&gt;
&lt;br /&gt;
m-t-* and other spacing utilities should be replaced with mt-*.&lt;br /&gt;
&lt;br /&gt;
m-t-1 is now mt-3&lt;br /&gt;
m-t-2 is now mt-4&lt;br /&gt;
m-t-3 is now mt-5&lt;br /&gt;
&lt;br /&gt;
A more detailed description of using spacing classes can be found on the [Bootstrap spacing utilities|https://getbootstrap.com/docs/4.0/utilities/spacing/] page&lt;br /&gt;
&lt;br /&gt;
The hidden-md-up and related classes have been removed from upstream Bootstrap, rather than using explicit hidden-* classes, you hide an element by simply hiding it at that screen size using d-sm-none. More info on the [Bootstrap utilities|https://getbootstrap.com/docs/4.0/migration/#utilities] page&lt;br /&gt;
&lt;br /&gt;
=== New grid breakpoints ===&lt;br /&gt;
&lt;br /&gt;
The Boost grid breakpoints are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.col-*  &amp;lt;576px&lt;br /&gt;
.col-sm-* &amp;gt;= 576px&lt;br /&gt;
.col-md-* &amp;gt;= 768px&lt;br /&gt;
.col-lg-* &amp;gt;= 992px&lt;br /&gt;
.col-xl-* &amp;gt;= 1200px&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All usage of &#039;*-xs-*&#039; have been dropped. What used to be col-xs-6 should now be written as col-6.&lt;br /&gt;
&lt;br /&gt;
*-md-* has become *-lg-*, and *-lg-* has become *-xl-*.&lt;br /&gt;
&lt;br /&gt;
=== Typography ===&lt;br /&gt;
&lt;br /&gt;
Boostrap 4 uses a native font stack that selects the best font-family for each OS and device. For font sizing the browser default root font-size (typically 16px) is used. this variable can be changed using the variable &#039;$font-size-base&#039;.&lt;br /&gt;
In the default Boost preset we use: &amp;quot;0.9375rem&amp;quot; which computes to 15px on most browser.&lt;br /&gt;
&lt;br /&gt;
== Commonly used utility classes ==&lt;br /&gt;
&lt;br /&gt;
Bootstrap 4 offers a wide range of [utility/helper classes|https://getbootstrap.com/docs/4.0/utilities/borders/] to quickly style elements without using any CSS code. Using these classes in your mustache templates has preference over writing custom CSS. &lt;br /&gt;
&lt;br /&gt;
An example of such a utility class is the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class.&lt;br /&gt;
&lt;br /&gt;
the .text-success class colors text green (#5cb85c) in theme Boost based on the default Boost preset using Sass variable&lt;br /&gt;
&lt;br /&gt;
/theme/boost/scss/preset/default.scss&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$green:   #5cb85c !default;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the [color|https://getbootstrap.com/docs/4.0/utilities/colors/] utility class allows you to change color based on preset variables instead of hardcoding the css in your theme.&lt;br /&gt;
&lt;br /&gt;
== Template changes ==&lt;br /&gt;
&lt;br /&gt;
=== Changed templates ===&lt;br /&gt;
Added boost/templates/head.mustache&lt;br /&gt;
&lt;br /&gt;
This template added the &amp;lt;html&amp;gt;&amp;lt;head&amp;gt;...&amp;lt;/head&amp;gt; part of your page&lt;br /&gt;
&lt;br /&gt;
Added boost/templates/navbar.mustache&lt;br /&gt;
&lt;br /&gt;
This template adds the fixed navbar at the top of the page containing the nav drawer toggle, brand, custom menus and user menu. In Boost for Moodle 3.4 and earlier this file was named header.mustache&lt;br /&gt;
&lt;br /&gt;
Changed boost/templates/header.mustache&lt;br /&gt;
&lt;br /&gt;
=== Template updates ===&lt;br /&gt;
Boost for Moodle 3.5 templates have been updated to use new Bootstrap utility classes for positioning and styling. Examples of these utility classes can be found in theme/boost/templates/core_form/element-duration-inline.mustache. In this template the bootstrap helper utilities for pacing and positioning  added were: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;d-flex ml-1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;d-flex&amp;lt;/b&amp;gt; adds this css property display: flex;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ml-1&amp;lt;/b&amp;gt; adds margin-left 0.25rem;&lt;/div&gt;</summary>
		<author><name>Basbrands</name></author>
	</entry>
</feed>