The design of output elements and the element library for Moodle is racing along, how they are going to be implemented etc is all under discussion presently and if it interests you check out the spec forum discussion
Here however I would like to share how things are shaping up in relation to themes.
Whats changing in Moodle
Within Moodle and its plugins the following is going to happen:
- We are going to adopt the atomic design approach.
- Moodle will get an assortment of atoms, molecules, and organisms each of which will be accompanied by a render method.
- Developers will be encouraged to re-use these elements as much as possible, and only create new ones when absolutely required.
- There is going to be lots more documentation on Output for Moodle, this will include how to write elements, how to write CSS for elements, and how to write renderers.
- An element library will be added so that you can view elements in one or more possible states.
- Elements will be styled in base and bootstrapbase. Styles for components will be put into a new elements.less/elements.css
- Conversion will be ongoing - it won't happen immediately.
- We hope to make Moodle frontend framework agnostic - meaning it should be possible to use the frontend framework you like in Moodle.
How this will impact theme designers
- Elements can be viewed in the element library, which gives you an easy place to style them.
- Elements get re-used so as more of Moodle is converted there will be less to style until we get to the point where you only need to style the elements.
- After this change there should be less and less CSS changes landing each release as more re-use occurs.
- The renderers for these elements will be free of logic making it easier to override the renderer and change the structure with more confidence.
- We will be encouraging developers to write better renderers, which will make renderers easier to override.
- We will likely introduce a lot of CSS when we introduce the elements to style them properly. It should be easier than before to style these.
- As we convert interfaces you will need to potentially re-style parts of Moodle you had styled previously. You may need to refactor your renderers and styles to remove now unused styles.
- You will need to keep abreast of changes to core element render methods in future releases, they should not change often at all but if they do change each change is a potential regression. Again with the element library it should be easy to check a theme still looks good after each release.
In summary - hopefully it will be easier and less work to style Moodle in the future. If you've any thoughts you'd like to share, any questions you'd like to ask, or any requests please don't hesitate to post them here.