Bootstrap3 for Moodle3.0

Bootstrap3 for Moodle3.0

by Richard Oelmann -
Number of replies: 76
Picture of Core developers Picture of Plugin developers Picture of Testers

At the MoodleMootUKIE Hackfest today there was overwhelming agreement that we should work towards adding a bootstrap3base theme to core Moodle. The current Bootstrap2 core themes would remain in place to support existing themes (to be eventually - long term, no time scale as yet! - deprecated in favour of BS3) with bootstrap3 added alongside.

To that end a new EPIC tracker has been set up https://tracker.moodle.org/browse/MDL-50241 - This will take the discussion forward from the discussion 18 months ago in MDL-407111

And the Google doc from the discussion https://docs.google.com/document/d/1nVmked-dQqdjCQb-GRwr9yFRRJ3tL62Iv7Vg7kIpBTU/edit?usp=sharing

Mary, Gareth, Bas and David - Hope you dont mind I've already added you as watchers on the tracker issue.

Individual tasks will be added to the EPIC in the next few hours/days.

Average of ratings: Useful (1)
In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Richard,

No worries.  I've already made a contribution here: https://github.com/bmbrands/theme_bootstrap/pull/360 which Bas incorporated here: https://github.com/bmbrands/theme_bootstrap/tree/MOODLE_29_DEV.

So is already in a good place to make rapid progress.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Yes, the concensus was that Bas will work to rename his existing theme and get it up to code standards for integration (with some help from David and probably yourself). That will, subject to whatever discussions take place here and tracker, probably form the basis of the new bootstrap3base.

Then we'll have a clean3 (or whatever we call it), but I do like Mary's idea in the tracker that we also need something with a bit more pizazz in core as well - even if its something like the bootswatch theme with a few 'more' settings. Simple, easy to customise, but a bit more about it than Clean has right now. Although I think we still need a 'Clean' or 'Easy' type basic theme for theme builders to have as a starting point. It would probably be good to keep it as close to Clean as possible, so that it might help people transition existing Clean - child themes across in time. If we could get it so that child themes that currently use clean could simply be re-parented (fostered/adopted?) that would be good, but whether it would be practical I dont know.

In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

If Martin agrees with this, and I do have my doubts about that, I do not honestly think it will ever be ready for Moodle 3.0.  However, if it does go ahead, then the likely hood of creating two branches of bootstrap vis (bootstrapbase and bootstrapbase3) is doubtful. Martin is more likely to demand that we change the lot from Bootstrap 2.3.2 to Bootstrap 3.3.4+. Basically trash the old BootstapBase and create a new parent theme and then remake the Clean and More themes to comply with the new layouts. It would be easier doing that from a theme point of view. However, the real problems will be in the work already started in Moodle core, that of modifying php mark-up to accommodate some of Bootstrap 2.3.2 css selectors.

It's a Mammoth task...and I do worry that it will all be in vain. I just wish we had an IN-HOUSE equivalent of Bootstrap 3, something we could nurture and call our own.

Thanks for listening

Mary aka LazyDaisy

In reply to Mary Evans

Re: Bootstrap3 for Moodle3.0

by Damyon Wiese -
"We’d love to tell you more, but the dust still has to settle before we open our first pull request with a live alpha release. In addition to launching in v4 in the coming months, we’ll be maintaining v3 with small bugfixes for the first few months after the new version ships."

- From the bootstrap blog.

We have a problem in that the short lifecycles of the different bootstrap versions does not match the long lifecycles of e.g. LTS Moodle versions.

There are no good answers until we improve our renderers in Moodle enough that it becomes easy and reliable to quickly swap frameworks.
In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Thanks Damyon, that is more or less what I had feared.

Cheers

Mary

In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Interesting Daymon,

But... the renderers are one thing, there is now Bootstrap 2.3.2 classes embedded in the core JavaScript and thus impossible for themes to override that.  It would be better to have Moodle only classes that where then mapped as appropriate with mixins etc.

Average of ratings: Useful (1)
In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by David Scotson -

There are no good answers until we improve our renderers in Moodle enough that it becomes easy and reliable to quickly swap frameworks.

At the Moot, the consensus was that more renderers was also the only sensible way to implement Bootstrap 3, so there's a strong overlap between the short term and long term goals here.

Bootstrap 3 based themes are already being put into production by organizations that place emphasis on the UI experience, who often hire people with a front-end focus to achieve that goal. They'd prefer if Moodle had more renderers so that they could deal with Bootstrap HTML, as they're used to from other projects, rather than try to fake it with complex CSS targetting Moodle's core HTML output. So it seems that co-ordinating that potential energy is key, as the work to expand renderers benefits everyone using, or working on, Moodle, regardless of whether they prefer Bootstrap 2, 3, 4 or something else entirely.

Average of ratings: Useful (3)
In reply to David Scotson

Re: Bootstrap3 for Moodle3.0

by Damyon Wiese -
We are willing to work on this for 3.0 - it doesn't have to just be a community effort - but to do so it would help to have the work broken down into tasks.

"there is now Bootstrap 2.3.2 classes embedded in the core JavaScript and thus impossible for themes to override that"

This is because of https://tracker.moodle.org/browse/MDL-40187 (Policy decision allowing bootstrap styles directly in core renderers).

We would avoid this upgrade headache if we had a layer in-between the renderers and the CSS framework - but at the cost of complexity. E.g. we could invent our own naming system for everything we need from a CSS framework like grids, responsive styles, button styles etc - and then use mixins to implement those styles using a framework - but this means a themer has to know the Moodle CSS naming system AND the bootstrap one, and it means we would limit the styles we can actually use to the ones we have defined in our naming system - and we would effectively be coming up with an entirely new CSS framework.

Lots of people have been discussing this problem for a long time - here is a comment I made about it last year: https://tracker.moodle.org/browse/MDL-45050?focusedCommentId=283160 which shows that we are taking steps to make this better.

What I see with templates, is that we have an opportunity to really improve the output in Moodle as we convert renderers to templates. If you see coding guidelines for templates (https://docs.moodle.org/dev/Templates#Coding_style_for_templates) - they are quite specific about documenting javascript dependancies, and recommending "data-" attributes for javascript hooks, and not classes etc.

But - another benefit of templates which I think will really help in future - is that they are just chunks of HTML and are really easy to search/replace (compare that to searching for a class passed to a html_writer function in a renderer).

So - in my mind - it will be simplest in future to have one "blessed" css framework, have core target that framework - and let themes support a different framework by overriding the templates. (We could create a tool somewhere to create a new blank theme by creating the required folder structure, version.php etc + copy all core templates to the correct locations in the theme in order to be overridden).

(Also maybe now twitter is using Moodle, they will see what a pain it is when they introduce backwards incompatible version bumps).

So - to end on a constructive note:

If we can create issues in MDL-50241 for the changes needed to nicely support a new bootstrap 3 theme - I'm happy to get HQ devs to help.

E.g. Identify missing renderers that need to be overridden, fix places that hardcode bootstrap 2 classes in core code, create the new theme and decide on the inheritance etc (does anyone agree/disagree about the way clean and bootstrapbase are split?), do we deprecate clean and bootstrapbase ?

Thanks.

Also - I fully expect bootstrap 4 to be released on the day we get bootstrap 3 working sad



In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Derek Chirnside -

Anyone:

What is a renderer?

(Explain, like as if I was 15)

Just curious, and good to see the dialogue here.

-Derek

In reply to Derek Chirnside

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Derek,

Like a tool you'd use to create pretty shapes in plaster to give it a 'render'.  So does more than a paint brush can achieve.  Being more complex and flexible to give a better result.  And you can change it depending on the situation.

Gareth

In reply to Derek Chirnside

Re: Bootstrap3 for Moodle3.0

by David Scotson -
A renderer is a a bit of code that spits out HTML, and which lets themes replace it with a new bit of code that spits out a different bit of HTML if they want to.

This gives themers flexibility, and makes it easier to upgrade Moodle's HTML as time passes. The biggest issue with renderers is that not all code in Moodle uses them, so people either need to do core hacks, or use complex CSS to make things look consistent.
In reply to Derek Chirnside

Re: Bootstrap3 for Moodle3.0

by Floyd Saner -

Ah, Derek.  A 15 year old would probably understand! It's just we older folks who need more simple explanations!  big grin  I get passed up by young kids all the time.

Floyd

In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Guy Thomas -
Picture of Core developers Picture of Plugin developers
If Bootstrap 4 is released around the same time as Moodle 3, a Moodle 3 supporting Bootstrap 3 would still be way better than a Moodle 3 supporting Bootstrap 2.
Average of ratings: Useful (4)
In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by David Scotson -
Regarding hardcoded bootstrap classes: it was always a shortcut, and I think it still has it's place e.g. I've been looking at adding a few bootstrap classes to the mform output to help layout the forms. Ideally a renderer based forms library used across Moodle would be coded, but in the meantime a bunch of ugly .less and CSS could be replaced with a few well chosen classnames, which would just be ignored by themes that don't need them.

One thing I learned at the Moot (from Andrew Davidson) was that Bootstrap have announced that version 4 will be just CSS, no .less or SASS. I think that's a very cool decision, but it does mean that the .less based workarounds we've used in Bootstrap 2 & 3 will no longer be available. As I pointed out in the issue I filed suggesting we add a YUI Pure CSS theme (MDL-40148) that requires near universal renderer coverage so that every bit of HTML can be changed. So, even if they do announce it tomorrow, we'd have no good way of using it till the renderer work got done.
In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Thanks Damyon, what you are saying sounds good and I am sure will work if we all stick together on this.

One thing that does bother me though, is that should we want to restyle something in a Bootstrap theme it is not as easy to 'exclude' a LESS file as it was to 'exclude' a base theme CSS file.

Remember in Moodle 2.0 lots of themes like Afterburner, Fusion, and Magazine, Overlay and Sky High, to name a few, started to change the page layout and so excluded Base theme's 'pagelayout.css' and the fact all of Base theme CSS had the component parts in separate CSS files made it easy to exclude. LESS is not that easy to override in this way in a normal theme like Clean but is possible in the More theme.

So perhaps it might be better to move away from Clean and Bootstrapbase and then use the More theme as a base for Bootstrap 3/4 'More Bootstrap' (morebootstrap) would sound good as a new theme. I love the flexibility of the More theme, because you can do a lot 'more' with it. smile

Thanks

Mary

Average of ratings: Useful (1)
In reply to Mary Evans

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Was looking at a potential Clean3 (or whatever we call it) over the weekend Mary - but obviously needs Bas' bootstrap3base theme work done before doing to much to it.

I think the ability to easily exclude LESS sheets is important (vital!), but I'm in two minds about the additional features like in More - perhaps we need to keep two different ones as we have now?

One like Clean (or Easy) that is a very basic starting point for anyone cloning to build from (maybe even make it not selectable in the first instance - the 'canvas' equivalent?), and one (which would be the default theme on installation) that has the flexibility that you are talking about, and the 'pizazz' you mentioned in another post.

I was wondering whether the default one should be a combination of 'More' and the existing bootswatch theme - that might encourage people to think in terms of creating bootswatches that are easily transferable from moodle site to moodle site and even across platforms where people integrate moodle with other platforms. What do you/people think?

In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

No Richard, we do not want a Canvas equivalent. Canvas actually caused more problems than it fixed

Looking back, however, it would have been better to have made Base a child of Bootstrapbase. I tried it the other day I was totally gob-smacked! It looked amazing!

As for the default theme, I think in the long run it will be Moodle HQ that will determine what they want as a default theme. It may be that Clean theme stays but gets reworked.  But at the end of the day these are minor worries. The big one is getting Bootstrap 3 into Moodle.

I can see that Bas has made a start on it, but I am not too sure about the use of $hassidepre and $hassidepost, etc.,which have to some extent been depreciated if you look at how Bootstrapbase and Clean themes work. All that info is dealt with in the theme's lib.php file and converted to HTML.

Mary

In reply to Mary Evans

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Oh nooooo!  Not the '$hassidepre' / '$hassidepost' argument again!  We would be better off with '$hassideelevation' / '$hassidepainted' and it would be less confusing ;).

And lets bring back jQueryMobile.... not.

In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Damyon Wiese -
We discussed this again in scrum today (HQ Devs).

There are lots of reservations about trying to add a bootstrap 3 theme in for 3.0.

* There is a general feeling that bootstrap2 was added too early and we spent a long time adding fixes before it was "production ready" - so adding bootstrap3 and releasing in one cycle seems rushed
* What are the real benefits of bootstrap3 over bootstrap2?
** RTL ? No they haven't done RTL support yet, but ours is mostly working with bootstrap2
** Accessibility ? No - the bootstrap menus etc don't follow the aria specs - especially weak on keyboard navigation
** It's newer so theme designers are more likely to be using it for other projects - Yes
** It's "supported" upstream - well not for long enough to be much use to us

In general, if we pour lots of effort into polishing a bootstrap3 theme for core, we will have to do it all again very soon for bootstrap4. It seems a much better use of our time to spend time improving the code (adding renderers/templates) so that it is easier for themers to add their own bootstrap 3 or 4 or YUI pure or Zurb themes (see https://tracker.moodle.org/browse/MDL-50148 for what we are starting work on here).

So - if you identify missing renderers and list them in MDL-50241 that make it easier to improve the existing bootstrap3 themes - and identify anything else that is making it hard for bootstrap 3 based themes we are happy to work on those issues in the 3.0 cycle. Outside of that - I think it's best to spend time improving the bootstrap 3 themes in the plugins DB, rather than trying to get more themes in core.
Average of ratings: Useful (2)
In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

@* What are the real benefits of bootstrap3 over bootstrap2?

In themes it is important to be able to adjust breakpoints for the layout needs. In Bootstrap2 the breakpoints are somehow »hard coded« in Bootstrap3 the breakpoints are way more flexible. Each time I work on a new theme I wish Moodle would use Bootstrap3 instead of 2. The breakpoint flexibility is a core advantage of 3 over 2.

In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

I am no fan of those big frameworks like Bootstrap or Zurb Foundation. They offer a nice toolset for prototyping but add a lot of unused bloat when used in production. If Moodle includes any of those frameworks and bends them to the actual Moodle needs in a way that it is not easily possible to update to newer versions of that framework as with Bootstrap2 I ask if this approach is the right way to go. Moodle will always be steps behind the actual state. 

Therefore I support Damyon's approach to change Moodle to be framework agnostic.

I think it would be very helpful to start the work on the Moodle Element Library. An ever growing MEL could be a central place to define and show how page parts and pages may look. And it could be a central place to test and evaluate templates, CSS naming conventions, the discussion to use classes or »data-« attributes for JavaScript hooks etc. All I have read in the docs or in the tracker so far are theoretical lists of aspects that may need to be included into the MEL. To use MEL as a lively growing development tool would bring a lot of advantages. I have gotten the impression that the MEL is mainly seen as a representation of existing elements to show theme designers how there CSS looks.

I think the MEL could offer much more - a lively platform for developers and designers to work on and showcase how Moodle pages look and work.

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Nobody is saying that's not the way forward Urs.

BUT - If we wait until the element library is in place and all the renderers are done - and with the rate at which Moodle develops anyway, then we'll be on BS2 in core until we hit about BS7!

The proposal is NOT to do this INSTEAD of work on the renderers/element library/templates, it is to do it as one of the steps towards making that progress. There seems to be a feeling among some, particularly at HQ, that getting the renderers/element library in place should be a blocker to getting a BS3 theme into core. Personally speaking, I disagree and see them as linked but side-by-side developments that would be mutually beneficial.

Average of ratings: Useful (2)
In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

Richard, why do you think a BS3 theme should be included in core? 

If the way should be to develop a framework agnostic Moodle and BS3 themes in parallel then Moodle core would better be without BS2 or BS3 and BS2/3 themes would be add-ons. The consequent way - as I see it - would be to remove BS2 from Moodle core and not to add BS3. This is a basic strategic decision and developing 2 parallel solutions needs more resources than developing one.

PS. From my other post you see that if Moodle keeps BS dependencies I think it should be BS3 and not BS2.

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by David Scotson -
Framework agnostic Moodle isn't one solution, it's an infinite number of solutions.

Bootstrap 2 and 3 aren't 2 different solutions, it's more like 1.1 solutions since they share so much code and design philosophy (though people keep telling me how difficult the upgrade will be, two years after we did it and shipped it).

Moodle has been following the pipe-dream of supporting any and all frameworks for a long time, while not even doing much to make that happen, and it has achieved almost nothing. Only an elaborate series of hacks even allows Moodle to look vaguely like Bootstrap. Has any other attempt even come close to implementing a third party front-end system into Moodle? Not beyond demos and proof-of-concepts. Yet both Bootstrap 2 and 3 Moodle Themes are used widely in production. It's not a coincidence that basically every comparable system to Moodle (and thousands of others that aren't) has adopted Bootstrap as a core framework to build on.

Even if we achieved this lofty goal, of supporting Zurb and YUI Pure at the same time, it would add no value to teachers and learners using Moodle. It won't even help devs who all walk in off the street knowing JQuery and Bootstrap. We shouldn't let the perfect be the enemy of the good here. Bootstrap gets the job done, I'd would be good to see some commitment to it, and plans for fuly integrating it, not vague and unworkable plans to replace it at some point in the future with some unspecified other.
Average of ratings: Useful (3)
In reply to David Scotson

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

David, you are right when you write »Moodle has been following the pipe-dream of supporting any and all frameworks for a long time, while not even doing much to make that happen, and it has achieved almost nothing.« and I'm very frustrated about that because it makes my Moodle work much more difficult than it could be. But with other people working at HQ now with a different awareness for Moodle development and theme needs I hope that this time changes will be implemented. And I see clear signals that there will. Let's not blame Moodle HQ for working on basic changes instaed of your and other's personal preferences.

To »hack« Bootstrap 3 into / on top of the actual Moodle code base would not really bring Moodle forward. The ongoing implementation of autoloading classes brings Moodle forward - with their help it is possible to split Moodle pages into »views«, feed in data from »models« and add something like »controllers«. No, it's not MVC, but all modular. And the views can incorporate templates.

The Element Library could be a great »tool« to develop all basics - for example naming conventions etc.
In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Guy Thomas -
Picture of Core developers Picture of Plugin developers

*** To »hack« Bootstrap 3 into / on top of the actual Moodle code base would not really bring Moodle forward.

I disagree - Moodle's markup is in dire need of being improved. To support Bootstrap 3 fully a lot of this markup would need to be (or at least should be) improved as part of the process.

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers
  • Because it is being requested by huge chunks of the community (100% of those at the uk/ie hackfest)
  • Because BS3 is the supported version of the bootstrap3 framework
  • Because it is already in widespread use (half a dozen or more BS3 themes in the plugins database, and in use by Moodle partners as their core theme for clients)
  • Because NOT supporting it in core is holding back adoption of BS3 themes (various comments about not wanting to use themes that do not fall back to a core parent)
  • Because Moodle is losing reputation by not supporting it (conversations I have had about one of Moodle's commercial competitors not having a responsive UI, to then have to counter the argument that Moodle's own UI in core is built on outdated versions of BS - not to mention the fact that that commercial LMS is likely to soon get a rebranding using that newer technology which would leave Moodle lagging behind even them)
  • Because it's based on good design principles such as mobile first
  • Because it would allow content creators, not just theme designers to take examples from the net and adapt-reuse them more easily than having to search out the BS2 equivalent

I'm sure I could think of other reasons, and that others in the community could come up with far more and far better, but that's just the first ones that come to mind.

The decision to move to bootstrap as the core themes was taken several versions ago - it would be difficult if not impossible to move back to non-bootstrap themes as the default now. Given that, I personally believe that the way forward should be supporting BS3 themes as default from Moodle3, maintaining the current BS2 themes for compatability the same way base and standard have been maintained for those themes.
Again, my personal feeling is that at this stage the discussion is not about bootstrap v a.n.other framework v framework agnostic. It is about the fact that we are already using bootstrap and that we should therefore be supporting the current version of that framework.

Whether we are moving towards a final destination of framework agnosticism I think is a different (albeit linked) discussion. To hold on to BS2 and refuse to move forward to BS3 based on an 'ideal vision for the future' will halt progress - stone age man didn't reject wooden wheels because they were waiting for the invention of the pneumatic, nitrogen filled vulcanised rubber tyre, or we'd still all be walking.
Martin's keynote at the UK/IE MoodleMoot asked the question 'How did we get from caveman to Stephen Fry' - I think I can guarantee the answer was not by waiting for Stephen Fry to come along in one huge revolutionary step!
Average of ratings: Useful (1)
In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello all,

Ok, as a theme developer well versed in Bootstrap V2 and V3 themes on Moodle I believe the following:

  1. Core development effort should be made to make the code framework independent, thus any 'frameworkisms' should be in the theme installation in the 'theme' folder only.  Thus any PHP or JavaScript file that needs 'glueing' to the theme should have Moodle specific 'classes' etc. only.  So no Bootstrap classes in JS files or un-overrideable lib.php files.  Its really easy for a theme to map Moodle to Framework styles in LESS by extending a class etc.
  2. In order to rapidly develop the Bootstrap V3 theme it should remain 'contributed' with all of the effort helping Bas and David achieve this using the GitHub repository and configuration management systems already in place.  If though this, deficiencies in Moodle core code are identified (in line with point 1) then these should be justified and acknowledged as genuine 'refactorings' that need to occur and accepted by Integrators as a good thing to do - even if nothing appears to actually change smile.  Need to modify the code to a point where it can be improved - there are 'smells' (in the Martin Fowler terminology) that apply here.
  3. Remaining contributed does not mean that the effort would be 'unofficial' as the code is already in a public repository and GPLv3 licensed.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, with the whole LTR / RTL thing.  I additionally believe that it could be better - hence what I have already demonstrated with Essential within the constraints of a contributed theme bound by the core API.

Currently both LTR and RTL styles are served in one big bulk.  This is inefficient and bad news for bandwidth on mobile devices.  Its like when you purchase a product and you get all of the other manuals that don't need.  Therefore it would be better for core Moodle to split the serving of 'all' (being the cached result when TDM is off) into 'allltr' or 'allrtl' as required.  How this would be developed in practice would I suspect depend on having three sets of files that can be identified by the code:

  1. Generics.
  2. LTR specific.
  3. RTL specific.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Bootstrap3 for Moodle3.0

by Damyon Wiese -
It's not as clear cut as that.

Because of the overhead of requesting separate files over HTTP - it is faster to serve a single minified CSS file than to split things up. It does mean extra overhead in the browser because of all the extra rules to process - but that has less impact than the slowness of serving separate files.

When HTTP2 is in widespread use - it may make sense to serve the CSS files separately.

It's also easier to spot a missing RTL style - when RTL rules immediately follow any rules that are LTR specific.

In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Damyon,

With respect it is as clear cut as that!  If you have LTR then serve a combined set of LTR styles only, if you have RTL then serve a combined set of RTL styles only.  Only one request.  Essential already goes some way to achieving this within the constraints of the current API, but does have to serve two combined minified files  with GZIP compression over the network as a consequence.  However, the size of the files is less in both instances, thus despite the overhead of a second call, the time 'on the wire' is reduced, thus less chance of a collision.  CSMA/CD (or CA with WiFi) has swings and roundabouts.

With "It's also easier to spot a missing RTL style - when RTL rules immediately follow any rules that are LTR specific." - then a mechanism needs to be devised for this to help the developer both spot missing styles and have separation of LTR and RTL styles for serving purposes.  After all, who is Moodle written for, the developers or the users?  If its the developers, then give up now.

Gareth

Average of ratings: Useful (1)
In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Richard, I found your one comment " Because Moodle is losing reputation by not supporting it (conversations I have had about one of Moodle's commercial competitors not having a responsive UI, to then have to counter the argument that Moodle's own UI in core is built on outdated versions of BS - not to mention the fact that that commercial LMS is likely to soon get a rebranding using that newer technology which would leave Moodle lagging behind even them)"  very interesting.

As I know right now, Blackboard, Desire2Learn, and Canvas do not have any form of responsive design.  Only Moodle does.  I and my students have been using Moodle's MORE theme quite successfully, from all types of devices, for about a year or so.  It is not 100% perfect, but it does work for almost everything.  For example, I had one student who told me that his computer broke right before my exam, so he did this exam from his iPhone!

So the competitors only recourse right now might be to argue that Moodle's bootstrap design is outdated.  Moodle has something that works (but is outdated), and they have nothing that works (so something that does not exist cannot be outdated, right?)  Sure, these competitors might make promises, but let's see who delivers.  This bootstrap technology had been around for a decade, so what are these competitors really waiting for?

To me, Moodle seems to have some of the most progressive and best "thinkers" and "designers."

In reply to Rick Jerz

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

I didn't say the people making that argument were correct Rick - only that they were saying it smile

The information I have (from 3 separate - and very different - sources now) is that at least one of those LMSs you mention is currently having a UI face lift based on HTML5 and BS3. I've already seen demos and screenshots of one of their products that has had this treatment.

But yes, Moodle is the leader in this regard and I'd like to see us staying in that position smile Especially as we have had responsive themes since around 2.2 way before we even started looking at bootstrap (Zebra, Krystle and others)

In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Richard, sorry for my mistake.  You are correct!

If I were a competitor, I would probably be making all kinds of claims.  I have recently worked quite a bit with D2L and Canvas, and my experience is that they are quite a bit behind.

In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Stuart Lamour -
Picture of Plugin developers

Pre moodle having a front end framework we did a project to decide which front end framework to use in developing our moodle site - as you would with any web project these days.

We built themes in bootstrap, foundation and whatever else was around at the time (pure was not) - assessing which contained the elements we needed to build a good moodle site.

I've since done the same with pure.

This basic assessment of what is the right tool for the job - contained all the ui elements necessary, had the best help and support, was easiest to document, required the least extra work etc - was a great process to go through and really help you understand your front end.

Mapping the current ui elements in moodle to those in different frameworks makes it pretty easy to spot which one moodle should use.

Happy to help HQ go through a similar process if that would help?

Once you get a single core framework working properly - then you could start thinking of how to support others?


In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Bas Brands -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers

Hi Damyon,

Wow this discussion has really started a lot of debate on the pros and cons of having a bootstrap3base theme and has brought the attention to front-end development strategies.

I understand your reservations on using a newer version of Bootstrap. During the Moodlemoot UK & Ireland hackfest we concluded that it can be done and does not have to be as complicated as getting bootstrap into core. For me that means there is a lot of community support for having this base theme and motivates me to continue improving it and keeping it close to the front-end strategy Moodle HQ is using.

The real benefit of Bootstrap 3 over version 2 imho I is  the improved grid system that helps build user interfaces in a multi device world. And I am very happy that from Moodle 2.9 onwards we can fully use the Bootstrap JavaScript using jQuery for both the bootstrapbase and the bootstrap3base themes.

So I am happy to keep working on the bootstrap theme with the help of many of you and I am happy to see it has had quite an effect of improving Moodle. 

Thanks!





In reply to Bas Brands

Re: Bootstrap3 for Moodle3.0

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

A few further thoughts on this:

Presumably the work that needs to be done divides into three areas:

  1. Create a new theme_bootstrapthreebase (I am pretty sure digits are not allowed in plugin names sad)
  2. Fix mess in Moodle core (e.g. hard-coded boostrap2 class names, lack of renderers) to make theme_bootstrapthreebase possible and good.
  3. Infrastructure improvements in Moodle core (element library, ability to support SCSS, ...) to help.

Until it is done, to me it seem easiest to work on 1) somewhere like github, where a small team can work without the extra effort of the Moodle integration cycle.

And irrespective of when 1. ends up being finished and submitted to core, 2. & 3. are clear wins for everyone, and those changes should be submitted to core ASAP as soon as each one is done.

So, the only real reason to commit now to getting Bootstrap 3 into core for 3.0 is around showing how valuable and appreciated this work is. I was certainly very happy with what was decided in the Boostrap discussion in Dublin while I was in the other room. But, in the mean time, waiting for a decision on 1. need not stop the work from proceeding.

(Also, delaying the decision on 1) gives us a chance to see when boostrap 4 comes out, and how easy it would be to make a bootstrapfourbase for 3.1.)

In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Damyon Wiese -
We discussed this again in scrum today (HQ Devs).

There are lots of reservations about trying to add a bootstrap 3 theme in for 3.0.

* There is a general feeling that bootstrap2 was added too early and we spent a long time adding fixes before it was "production ready" - so adding bootstrap3 and releasing in one cycle seems rushed
* What are the real benefits of bootstrap3 over bootstrap2?
** RTL ? No they haven't done RTL support yet, but ours is mostly working with bootstrap2
** Accessibility ? No - the bootstrap menus etc don't follow the aria specs - especially weak on keyboard navigation
** It's newer so theme designers are more likely to be using it for other projects - Yes
** It's "supported" upstream - well not for long enough to be much use to us

In general, if we pour lots of effort into polishing a bootstrap3 theme for core, we will have to do it all again very soon for bootstrap4. It seems a much better use of our time to spend time improving the code (adding renderers/templates) so that it is easier for themers to add their own bootstrap 3 or 4 or YUI pure or Zurb themes (see https://tracker.moodle.org/browse/MDL-50148 for what we are starting work on here).

So - if you identify missing renderers and list them in MDL-50241 that make it easier to improve the existing bootstrap3 themes - and identify anything else that is making it hard for bootstrap 3 based themes we are happy to work on those issues in the 3.0 cycle. Outside of that - I think it's best to spend time improving the bootstrap 3 themes in the plugins DB, rather than trying to get more themes in core.
Average of ratings: Useful (1)
In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers
This was discussed again at the Moodle HQ Dev scrum - which has come to a very different conclusion to the MoodleMoot Hackfest community. In that hackfest we went through the pros and cons that were in the previous discussions on this topic a year or so ago. The only concern left at the end of that was that the HQ developers would continue to resist this move that had 100% support from those present at the hackfest and that proves to be the case.

* There is a general feeling that bootstrap2 was added too early and we spent a long time adding fixes before it was "production ready" - so adding bootstrap3 and releasing in one cycle seems rushed
Yes, I made that point frequently at the time of integrating BS2 and was overruled. And at the hackfest I made the point during the discussion - I was one of those who quite openly at the time said that I did not believe we were ready to integrate bootstrap, or how we did it - but we did and over  the last few years huge strides have been made in creating bootstrap themes, to the extent that I now consider that we need to ensure that if we are saying we are primarily supporting bootstrap as our theming framework, we need to ensure we are fully supporting it in its most current version! BS3 has now been in use in community themes for some time, there are already about half a dozen in the plugins database and its in mainstream use not just experimental. Its not just adding it in one cycle, it has been worked on by people like Bas, Stuart, David and Gareth for some time (as well as others like Danny and myself).

* What are the real benefits of bootstrap3 over bootstrap2?
This is the supported version of BS - and has been for some time - if anyone wants to use BS in their content, they are likely to go looking to the BS sites and pull off details relevant to BS3. It encourages the development of content through a mobile first approach as recommended in many web development strategies. I am not familiar enough with the benefits from a more technical aspect to list those, but Im sure someone like David could add to that. There's also the 'public image' benefits - 'oh yes Moodle, that only supports older technologies like BS2 though doesn't it, not exactly cutting edge, not even on a recent stable version' And yes, I have already heard those comments made and defended them by pointing out the community support for BS3!

** RTL ? No they haven't done RTL support yet, but ours is mostly working with bootstrap2
And is 'mostly working' in the exsiting bootstrap3 themes in exactly the same way. - Could it be improved, of course, but the solutions in BS3 are no worse than those in BS2

** Accessibility ? No - the bootstrap menus etc don't follow the aria specs - especially weak on keyboard navigation
And how is this different between BS2 and BS3?

** It's newer so theme designers are more likely to be using it for other projects - Yes
And allows easier theming across sites using multiple platforms such as WordPress etc that already support it and have for some time
But its not only theme designers - I have several tutors in the situation I mentioned above. They are fairly web-savvy and having been told our theme was using bootstrap went looking to add several BS components into their content to improve its appearance and found they couldn't because we are using BS2 and the main BS site is BS3. Yes the BS2 examples can be found, but I then had to make the explanations about not supporting the current version.

** It's "supported" upstream - well not for long enough to be much use to us
And that is an argument potentially caused by the failure to support BS3 when it first came out and has the potential to run and run. Supporting BS3 was first mooted when it was initially released and was rejected because it was too new, we were only just doing the work for BS2 (maybe too early - probably should have been the perfect time to focus on BS3 then, but that was rejected, but that's done). If we don't move forward until BS4 comes out we have many more potential issues - we tie in even closer to BS2 making more work to convert, BS4 is too new when it comes out, but by the time we have this discussion again they are announcing BS5. Its an argument that will go around in circles.
And in all honesty - its supported longer than Moodle versions are!

Yes renderers are essential and that work needs to be done. But the call at the community driven hackfest was to get a BS3 supported theme into core, which can then be a focus for a continued push on all those areas of moodle core code that still need rewriting as renderers.
There are Bootstrap2 themes and bootstrap 3 themes - has anyone actually created a Pure (YUI is dying so this is unlikely) or Zurb theme? Yes, I've added a (experimental) flexbox based one that replaces the grid in - oh yes bootstrap3! -  But are there actually any other frameworks that people are using or want to use for themes that require that work to be prioritised over and above the supprot for the current version of our existing framework. And surely rewriting renderers so that a. they exist and b. they are better written to support good web standards/semantics is going to be a major ongoing project that will benefit anyone wanting to use those renderers with another framework anyway.

Bootstrap 3 themes are already in use, they are already being built and used in the community. One of the things holding back even wider adoption is the fact that they have to either be built as standalone or they have to rely on a parent theme which is itself not in core. The community is using this technology already. I personally feel it is to the detriment of Moodle to be seen as not supporting this at this stage.

It seems HQ are more than happy to push tech changes that no-one in the communty knew much about (such as mustache templates) for whatever reasons, positive ones Im sure, but seem very resistant to the idea of supporting work already largely done by the community to support the BS3 themes that many people want. Other than HQ developer reluctance I don't see any valid arguments in the above not to be taking on board the support for a Bootstrap 3 core theme.


Average of ratings: Useful (6)
In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

@»It seems HQ are more than happy to push tech changes that no-one in the communty knew much about (such as mustache templates)«

I very much appreciate that Moodle HQ is taking the challenge to work on the Moodle core basics - a huge but long overdue task as I think. To give Moodle a consistent and easier to handle code base which makes the work easier for designers and for developers is a great investment into Moodle's future. Templates make the work on complex pages easier and it supports not only the Bootstrap fraction of Moodle theme designers but all Moodle theme designers.

Richard, your and other's favorite is Bootstrap. But please keep in mind that you are biased - with your arguments for Bootstrap you argue against all others who want/need to work differently. Here in the Moodle theme forums one may get the impression that Moodle themes are only build with Bootstrap - but that is not the case. Moodle themes should be flexible and theme creations should fit into different workflows - not only Bootstrap.

In the blog post »How to choose: Bootstrap vs. Foundation« https://fruition.net/blog/bootstrap-vs-foundation/ from  November 17, 2014 I found some numbers: »According to BuiltWith, 7% of the top 10,000 sites use Bootstrap«, »According to BuiltWith, only about 1% of the top 10,000 sites use Foundation«. 7% and 1% are both relative few sites using either Bootstrap or Foundation. I don't see the need for Moodle to support Bootstrap and ignore all others in core.

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

That would have been a useful discussion a few years ago Urs when I was arguing that we should not focus on Bootstrap at all.

From WHERE WE ARE NOW - ie we are already supporting bootstrap2, my strong feeling is that we should be supporting the latest current version of bootstrap

THAT is as far as my argument goes. I have not at any point argued against any other framework and have in the past been very vocal in my support for the process of maintaining the ability to use other frameworks. I do not feel that this is a display of 'bias' but of recognising the facts of where we are now.

In fact - if you want to look at other frameworks, then if you look at contributed themes, you will find there is one built on UIKit rather than bootstrap at all, and I think you will find that the only other recent them in the database that uses anything other than bootstrap is probably my flexibase, where I took the flexbox framework and added it to bootstrap3. So I feel I can talk as someone who has taken practical steps to implement other ways of working beyond simply throwing bootstrap at everything. And yet, I would fully support adding a bootstrap3 theme to core, regardless of whether you consider that to be a personal bias rather than my feeling that my points are based on cogent arguments put forward in many places. And given that you do not know me or any of my other work (most of which is not based on Bootstrap and includes using SCSS rather than LESS, Foundation and no framework at all - and of those bootstrap is not actually my favourite, but its the one Moodle HQ went with a few years ago) your accusations of bias are without 'foundation'.

The fall back to 'you are biased' is not a helpful route for any discussion to take Urs and I would ask you not to keep repeating it please.

If there is anyone out there with a working Foundation/Pure/other framework theme that could be developed as a core base theme the way there is for bootstrap, perhaps they would like to add it to the plugins database (where the existing bootstrap theme has been for some time) so that users can look at it, see it, build with it and work to get it in core as well at some point in the future. In the meantime, please can we focus on providing the best user experience we can with what we've got

Short term - add bootstrap3 to the existing bootstrap support

Short, Medium and Long Term - enhance core code and renderers to make core easier to theme, build on, regardless of a developers chosen work flow or framework.

In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

Ok, I'll stop. It's anyhow too much Bootstrap around here for my sense of taste wink

My contributions where not meant personal, I apologize if somebody feels offended.

In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by David Scotson -
I'm happy to see core focus on missing renderers (and consistently using the renderers we already have). This was the most obvious problem discovered while creating the original Bootstrap 2 Moodle theme back in 2012 , and didn't get the attention it needed then or since. I'll dig out the various bugs I filed at the time and add them to that tracker.

It would be nice to see some commitment to following the standard front-end best practices that are encoded in Bootstrap (of any version, and they're shared with most popular alternatives) but for whatever reason that seems a hard sell. We already have Bootstrap 2 as the default theme but struggle to follow their best practices in things like semantic alerts so I suppose a shift to 3 wouldn't necessarily fix that either.

There would definitely be benefits to the wider Moodle ecosystem of a clear frontend vision committed to following Bootstrap, with enough forward planning to cope with upgrades, like many other comparable projects have, but frankly, compared with the lack of renderers and the prehistoric state of much of the core HTML (We still have tables for layout!) it's a minor problem.

My main worry is, that without the guidance of Bootstrap's design decisions, the API for the newly created renderers will be terrible. Again, in theory we already have Bootstrap 2 as a core component, but it's not helped so far with attempts to rationalize the existing renderer APIs into something simple, sane and modern. Though that, like renderers generally, has not been a big focus of work so far though there was some discussion about it. Hopefully any new renderer work will start with figuring out the right way to do it, and not be too constrained by existing practice in Moodle, down to the level of recreating obvious bugs and design flaws in new code.
Average of ratings: Useful (4)
In reply to David Scotson

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

David, did you follow Damyon's work? For example 

Did you try to work with the new code? 

I see many signals for fundamental changes in the writings and in Moodle core and I hope for progress.

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by David Scotson -
Yes, I've seen this work, in at least one case it's involved rolling back changes I made in order to make the new code 100% compatible with Standard theme and the old Moodle way of doing things rather than using the design principles of Bootstrap 2, which is the current default theme of Moodle. Which worries me greatly as it'll be the second perfect opportunity to fix the frontend APIs that's been missed.

In general it seems we're chasing the *shiny tech* rather than do the boring stuff like make the front page or login page a renderer so that people can change it in themes without core hacks. I have nothing against the actual changes in themselves, but I think the process of setting priorities must be very broken for that to have happened before the basics that need done. (Did I mention we still use tables for layout?)

I personally use the Element Library that Totara released a couple of years ago. It got offered to core but they wanted to write their own, but it's been a great deal of help to me when working on themes, and still seems far more comprehensive than the one currently in core.
Average of ratings: Useful (2)
In reply to David Scotson

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

David when I remember right you had written in a posting some time ago that the huge amount of work that has gone into making Bootstrap work with the Moodle IDs and CLASSes is giving the false impression that Bootstrap and Moodle work well together. Looking at the amount of »glue« code involved shows that it is not. And this »glue« code is the reason why the change to Bootstrap3 is cumbersome.

A Moodle cleanup may be a way out.

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

The reason for all the 'glue' to join the sand together is because there are far to many gains of sand on the beach to style individually.  This needs to be reduced in the first instance before improvements can occur.  For example, I started on MDL-43112 a while ago to perform the 'simple' task of 'Change all "smallicon" and "iconsmall" classes to "icon-small"' so that there would be consistency in icon size styling.  But have to admit defeat as its too complex a job for any one person to justify that 'no pixels were harmed in the process'.  This should be screaming 'alarm bells' that something that should be relatively trivial is not.

So, I'll say again, refactor, refactor, refactor, progress will not be made without it.

And does Bootstrap V3 need to be in core because people are prevented from moving forward? No, because its already available and maintained by Bas with good community support by developers like myself.  If you need Bootstrap V3 for Moodle then its already available for M2.8 and below with an M2.9 version in development.  My Shoehorn theme is BS3 and already released as a 'release candidate' for M2.9 within the same month that M2.9 was released.  So where are the barriers?  I see none, only the opportunity to progress and suggest improvements to core to make it a better world to live in for all frameworks and their themes.

Bootstrap V3 in core now would be running before we can walk.

In reply to Gareth J Barnard

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Except that many institutions/organisations will only support themes with parents in core Gareth, and while that may not make any more sense than institutions that wont upgrade past IE9 or institutions that wont allow Chrome or Firefox, it happens and therefore holds back bootstrap3 adoption.

As for refactoring, improving, rendering, yes, yes yes! smile

But I don't see that as a blocker for supporting bs3 in core themes - its work that needs to be done whether we stick with just BS2, add BS3, or move towards a system supporting any and all frameworks that come along.

In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
But Richard with "Except that many institutions/organisations will only support themes with parents in core Gareth", Essential is a standalone theme with no parents in core and so many organisations 'don't' use it because of that ;).  It could be Bootstrap 3 and I wonder how 'unpopular' that would be :D.
Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Many institutions will use them, doesn't stop many institutions not using them (my own unfortunately being one of them in the past, although I'm working on that smile )

Many <> Most - Just a (potentially) significant number and something I've had personal experience of. I've also come across in the past different attitudes to entirely standalone themes, such as Essential and those with parents which are third party contributions - institutions which are prepared to work with a single contributed theme, but not with one that relies on a second contributed, non-core theme. That has arisen in discussions with people requesting me to build themes in the past.

As for how popular Essential would be as a standalone BS3 - with the effort and work you put into it and the way it was used from Julian's original version - I'd guess very (maybe more? ;) ), would be nice to see others get the same love and attention.

In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Stuart Lamour -
Picture of Plugin developers

There seems to be a contrast here between the community and your users needs - those discussed at the hackfest, in the tracker, on github, and in the forum - and what was discussed at the hq scrum you mention.

Might it be advantageous to have some representatives from the theme dev community at your meetings in future Damyon?



Average of ratings: Useful (3)
In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

Folks, you Bootstrap supporters are biased and you support each other in your opinion that Bootstrap is the only and right way for everybody. It's not! Moodle should be open for more than one party.

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Urs - that is not the case.

If you are willing to read back through my posts when the decision was originally made to adopt Bootstrap, I was one of the people who considered it a bad move, that we should be looking at ensuring Moodle was developed as framework agnostic. Maybe if a few more people had followed what I said back then, we might be further on the road to 'framework agnosticism' now - but I feel we would be further behind in actually creating themes because we wouldn't have had the core support for BS2.

That did not happen, that decision was taken by HQ and Moodle has moved towards bootstrap. Whether that was right or wrong, whether it was one step on a journey towards finally improving renderers to the point where they can be used by any and all frameworks is not the discussion here and is not an issue where I disagree with you. I would be more than happy to see the renderers properly developed to make Moodle usable by any and all frameworks. But right now, we are at a point where we are using bootstrap and there is a community driven need to support the latest current version of bootstrap. That is not intended to prevent progress in writing/rewriting renderers and core code, but to move forward in managable steps alongside the work being done on renderers.

We have been talking for several years about the need to write and rewrite renderers and that is happening, but its happening slowly. And fine, if HQ takes the decision to build those renderers in a completely framework agnostic fashion, so be it.

The current issue though is that we ARE supporting Bootstrap as our core themes - that is not a case of where everyone might want to be, or of where we want to get to (as important as those are!), but of where we ARE. My opinion then, and the focus of my points in this discussion is NOT to prevent the move forward with renderers, but to argue the point that that move should not be blocking the adoption of the current version of the framework which is ALREADY IN USE in core.

Holding back to Boostrap v2 leaves us falling further behind other CMS/LMS products. Bootstrap v3 is not a final solution, it's a step forward. I think its one in the right direction and I think its one that can be in place for Moodle3.0 because its already largely there in the community themes and in widespread use.

If you are asking for directions to go somewhere, its not helpful if the response starts 'Well, I wouldn't start from here'!

We are where we are, we are already supporting bootstrap, so as that is a given - what is the best way forward for moodle3.0? I believe that is to support bootstrap3. I have been persuaded that that is the correct way forward by following and participating in those discussion over the last few years and anyone who has followed my posts through those discussions will know very well (David and Stuart in particular have been on the other end of some of those earlier discussions) that I am not and have never been a bootstrap supporter simply because of the fact that its bootstrap, but because I have been persuaded that this is the best way forward for Moodle from where we currently are, rather than where I want us to be.

'Fanboi' arguments and finger pointing are NOT helpful to the discussion. If there are cogent points that argue against the adoption of Bootstrap3 and retaining only bootstrap2 in core then by all means bring them forward and we can discuss them. If you want to argue for dropping bootstrap altogether, then make that argument and see what support it has. But please don't accuse me or anyone else of simply supporting bootstrap3 (this discussion as already pointed out is not bs v nothing v anything, its about supporting bs3 when we already support bs2)  because it is 'the only way' as that takes away from what I believe are logical points being made in this discussion.

Average of ratings: Useful (1)
In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Guy Thomas -
Picture of Core developers Picture of Plugin developers
I'm sure there's bias in any technology proposed and used in Moodle. So long as the reasons for selecting that technology are well justified then I can't see a problem. 

Having Moodle open to more technologies isn't as important as facilitating a good user experience. Bootstrap has already made a massive improvement on the Moodle user experience. 

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by David Aylmer -

Hi Urs,

The corporate I work for have all of their sites on bootstrap 2&3, so I will accept your labeling of bias, because my personal opinion really is that I think bootstrap is the way forward.

I have some comments here. 

1. Regardless of the discussion of competing UI frameworks, fixing core code that spits out HTML that isn't via renderers *must* be a priority.

2. We hire front end developers that list bootstrap (2/3) on their resume/c.v.'s. Most of the time they have never worked with moodle before. The estimates they give for themeing/design work is almost always doubled/tripled due to moodle "not really being bootstrap" (even though it claims to be..). Our (expensive contractor) front ends should be able to target bootstrap classes directly. They need consistency. So maybe it is selfish for me to demand this second point, but I feel like I am in the comfortable majority.


- David

Average of ratings: Useful (3)
In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by David Scotson -

It's a little bit sad that I noticed that my comments from January 2014, when Bootstrap 3 was previously decided against apply so neatly to the current situation, and even then it was just a repitition of what I'd suggested a year before that when 2.6 planning was happening:

I would have thought that if a task takes longer than a single dev cycle then the obvious thing to do is to break it into smaller tasks that can be shipped individually. If we delay starting on this for another 6 months (note when this bug was filed) then that's just 6 months more work being done on older Bootstrap without clear guidance on what's going to happen next dev cycle.

My institution upgrades every (northern-hemisphere) summer to the even versions i.e. we're still on 2.4 and moving to 2.6 this summer (with the intention of using a Bootstrap 3 theme), with 2.8 planned for next summer, so I'd be happy to see some advance thought given to what's going to happen in that time frame so that work can begin now rather than be delayed again in 6 months time because it's been left too late to get it all done in a single dev cycle.

When the FRONTEND team asked in the forum for input on their plans for 2.6 I suggested (amongst other things, like upgrading to Bootstrap 3):

  • Copy current renderers into Base theme
    • Rewrite all current renderers with Bootstrap compatible code
    • As part of above, break current renderers into modular logic and display parts...
    • ...and tweak renderers API to better suit modern frameworks (might need simple API translation layer in Base renderers)
    • Shift a few more bits of code into using renderers that already exist (alerts etc.)
    • Shift a few more bits of code into newly written renderers (grids, a-z pickers, forms, ...)

and that still seems like work that needs done to help the front-end and are easily broken into bite-sized chunks of progress that aid those working on Bootstrap 2.3 and/or Bootstrap 3 and/or YUI Pure and just generally makes life easier for Moodle devs and themers.

https://tracker.moodle.org/browse/MDL-40177?focusedCommentId=264246&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-264246

What can we do to avoid having this conversation for the fourth time in another 18 months?

Average of ratings: Useful (2)
In reply to Damyon Wiese

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

But the long life-cycle of a Moodle LTS is primarily for security fixes and not features anyway. It hasn't altered the 6monthly schedule of development/release

In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

From the 'horses mouth', Bootstrap 4 looks like all SCSS: https://twitter.com/mdo/status/591364406816079873 - but interestingly there is mention of 'PostCSS' which I'd not heard of.

In reply to Gareth J Barnard

Re: Bootstrap3 for Moodle3.0

by David Scotson -
Bas's Bootstrap3 theme already uses postCSS to automatically add the browser specific -webkit etc. CSS for you, using a tool called autoprefixer. It's very cool tech.

I'd picked this up wrong, and thought BS4 was the one that was going to be PostCSS based, looks like that won't happen till the version after.
Average of ratings: Useful (1)
In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Simey Lameze -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers

My -1 to upgrade bootstrap 3 on moodle 3.0.

I think we should consider upgrade bootstrap, but not for the next release. This might not be an easy and fast upgrade and certainly would cause regressions.

The projects and goals are already defined for 3.0 and for me would be a mess try to upgrade bootstrap at the same time.

AFAIK, the upgrade to bootstrap 2 was painful and full of regression so, I don't see the reason to take risk of what will be one the greatest moodle release ever.

IMO, we should use/create more templates for 3.0 then the upgrade will be less problematic.

That's just my opinions, let's be more cautious with core changes in such a short time.

Thanks 

In reply to Simey Lameze

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers
After a bit more thinking my opinion about Moodle and Bootstrap is

  1. Either remove Bootstrap from core.
  2. Or fully integrate it (means use Bootstrap hooks everywhere in templates and renderers).

Simey's description »This might not be an easy and fast upgrade and certainly would cause regressions.« and »the upgrade to bootstrap 2 was painful and full of regression« is the evidence that hacking Bootstrap onto the actual Moodle codebase should not be the way to go. So the only ways out seam either 1 or 2.

The inconsistent Moodle interface codebase is the problem - not Bootstrap. And this problem needs to be solved. I recommend to start working with a Moodle Element Library as a development/design tool and not to see it as a theme designer's showcase when everything is ready.

To me it would be ok to build Moodle interfaces based on Bootstrap. It would be a dream to be able to add a class to an element and have them look the same everywhere in Moodle. And with templates it would not be that difficult to upgrade a core Bootstrap implementation.

Average of ratings: Useful (2)
In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Urs,

I'm gob smacked, but those two points are not the way forward.

With '1' you are left with going backwards and Moodle out of the box looking like a late 90's Windows 95 web browser screen shot.

With '2' full integration you leave no room for anything else and tie in Moodle to Bootstrap.

The real solution is 'modularity' being the first 'M'.  Currently this is almost there.  A structured walk through and refactoring is just needed to separate bits of code that have been integrated already like '2' and hence the problem we face now.  All Bootstrap hooks should be in the Bootstrap theme and that theme alone.  Yes the template library is a good thing.

Interfaces are also a good thing, but need to be written as they are in Java where you define what the application wants then the module (Bootstrap) implements them in the way it needs to.  The application itself has no conceptual knowledge of Bootstrap it just knows that its functionality is implemented.

However I do agree with the inconsistent codebase and the need for 'implement once apply everywhere'.  For so long themes have had to style every single grain of sand on the beach rather than using 'components'.

I really like your Mustache work and am disappointed to read what you have said here with those two points.

Gareth

Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

Gareth, I wanted to tell my opinion and the basic underlying insight is that Moodle core needs to be changed. The approach to conceal the base issue by adding coverings should be recognized and stopped.

In point 1.) is implicitly contained the modular approach you mention. You may guess that I don't propose to use a »late 90's Windows 95 web browser« look as the base style for Moodle.

For me the situation we face now is worse than an approach where the Moodle user interface bases on Bootstrap. The advantage of easy and consistent styling with a set of predefined hooks counts. If the decision may be to relay on Bootstrap I'm fine - it's better than what we have now.

In reply to Gareth J Barnard

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers

Gareth - with »The inconsistent Moodle interface codebase« I meant the user intrerface - the HTML pages - Moodle displays in the browser, not class/object interfaces in code.

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

My bad, interpreted the word 'codebase' to mean 'code'.

It is becoming clear that there is no clear consensus on the exact way forward, but that there is a 'mess' that needs to be cleared up before progression can be made.

In reply to Urs Hunkler

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

+1 Urs

The idea of getting a bootstrap3base theme into core is only one step in that direction. Sorting out the core code base is definitely the target!

I believe the theme can be achieved for Moodle3.0. Consistency in the codebase is a far bigger project and will take considerably longer but is ultimately what needs to be done!

At this stage, I don't think removing bootstrap entirely is an option, based on decisions previously made and where we already are. I'm not sure what support that idea would get from either the community or HQ.

In reply to Simey Lameze

Re: Bootstrap3 for Moodle3.0

by David Scotson -
The actual proposal from the group at the Hackfest was to *add* Bootstrap 3 to core, not to upgrade the existing Bootstrap theme. Bootstrap 2 would still exist and any theme's based on it would work unchanged.

The many people already using Bootstrap 3 based themes wouldn't be deterred if it wasn't the default in the first version, or even if it had a "warning: not quite ready" label on it. But having it in core would be helpful for various reasons outlined in this thread, chiefly that the limits of what you can achieve within a theme have been reached and fixes to core code are required to advance, and importantly that it would signal that we're actually planning ahead and not just burying our heads in the sand about this and hoping that Bootstrap 3 will go away if we pretend it doesn't exist for long enough.

I could have a long and interesting conversation about why the integration of Bootstrap 2 caused so many issues, but let's just say that I don't think it was anything to do with Bootstrap itself, more to do with the fact that the obvious route forward was ignored repeatedly until popular pressure built up and forced a change. De-ja vu?
Average of ratings: Useful (2)
In reply to Simey Lameze

Re: Bootstrap3 for Moodle3.0

by Urs Hunkler -
Picture of Core developers
In the analog world if it may no longer be possible to modernize an old building the building gets torn down and rebuild from scratch. Or it is kept as a museum and the inhabitants move on into a new building somewhere else. In the digital world this is also an option.
Average of ratings: Useful (2)
In reply to Richard Oelmann

Re: Bootstrap3 for Moodle3.0

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

My thoughts, for what they are worth:

  1. Adding Boostrap 2 was a necessary enabler all the great improvements Moodle's look out-of-the box appearance between 2.4 and now.
  2. Adding a large framework to core to support this, and having to support two base themes, base & boostrapbase was a cost, but the improvements show it was worth it.
  3. It is a pity that some things went backwards (e.g. boostrap2 classes going into core code) but again, overall, things are better for users, so while we have clean this up in future, in the short term 2.4 -> 2.9 it was worth it.
  4. Now, the biggest priority, as discussed in this thread, is less frame-work specific stuff in core, clean up Moodle HTML further, element library, etc.
  5. I think that adding boostrap3 to core as a third base theme might be a good way to actually force a lot of that to happen.
  6. Except, if Boostrap 4 is coming out in December, well, how hard is it to upgrade from the current boostrap3 theme to make a bootstrap4 theme? The changes 3 -> 4 look much smaller and more backwards-compatible than 2 -> 3.
  7. If so, should we skip a stage in core, and just add a BS4 theme to core as soon as possible?


Average of ratings: Useful (4)
In reply to Tim Hunt

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Good points Tim.

With M3.0 in November and BS4 in December, then Moodle would appear to be out of date as soon as its released - not good PR.  Therefore make the theme an official 'optional extra' outside of the constraints of core LTS, so that during the lifetime of M3.0 the base theme moved from BS3 to BS4.  Then there would be 'trust' from those who need a HQ supplied base theme as a foundation if they are worried about a contributed base theme as Richard implies.

In reply to Tim Hunt

Re: Bootstrap3 for Moodle3.0

by David Scotson -
Where is the info on the December release of Bootstrap 4 coming from? There was speculation that it would be released *last* December, but obviously that didn't happen. There apparently has been work going on in a private repo for a good while, so in theory they could release it tomorrow. On the other hand they usually have months of public alphas before release, so this December seems more likely as a release date, I've just not actually heard anyone state that as a target date. I've not checked recently so if there is new info on potential release dates it would be good to have a source for that.

But I'd like to keep emphasising how much Bootstrap 2 and Bootstrap 3 share, because if you believe everything you read on this forum you'd think they were two entirely separate projects, and (based on nothing more than speculation since it's not been publicly shown at all yet) how much they both will share with Bootstrap 4. The core of Bootstrap is just industry best practice, they even share a great deal of their basic HTML with every other competing framework, as well as between versions. I never wanted Moodle to adopt Bootstrap 2.3.2, I wanted us to adopt "Bootstrap" and to grow with it as time passed, that includes the upgrade to 3 we've been putting off for a couple of years, and a future upgrade to 4 whenever it gets released.

The opposite of that point is to emphasise what Bootstrap 2,3,4 don't share with current Moodle. They won't use tables for layout, they won't lack a responsive grid for layout, they won't let people use any random classnames for alerts that they want and magically hope that it works somehow, they won't expect every element to be hand-coded in subtly different ways every time it's used. All those things need fixed regardless of Bootstrap version.

The unspoken assumption seems to be that Moodle is so bad at planning upgrades of 3rd party components, that if we start working on Bootstrap 3 today, then Bootstrap 4 is basically off the table forever so we need to choose now and forever which exact version to support. Why don't we just commit to "Bootstrap" and plan for upgrades as and when they arrive?
Average of ratings: Useful (2)
In reply to David Scotson

Re: Bootstrap3 for Moodle3.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

"Why don't we just commit to "Bootstrap" and plan for upgrades as and when they arrive?"

I thought that's what we were doing when we took on BS2, which is why I have been stunned to some extent by the objections 18months ago and again now!

We are already using bootstrap - we are not, and never have been, proposing such huge radical shifts as dropping some framework to adopt a completely separate one, just ensuring we support the current stable version of the framework we are already using. Not sure why that has become such a big deal!

Yes, its surrounded by all the work on renderers and everything that goes with that, and templates now as well - but those are essential improvements regardless of the BS version supported by a core theme. Some of the comments seem to come from the standpoint that if we move to BS3 that's instead of the work to improve renderers etc. And I don't understand where that viewpoint comes from either - Surely the situation called for at Dublin is both, not either/or! Linked, but not exclusive issues!

In reply to David Scotson

Re: Bootstrap3 for Moodle3.0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Good point about the release date for BS4 David.  Googled it and found: http://iamkevinrhodes.com/top-5-bootstrap-4-features-coming-2015/ - so was December 2014, so already late by that metric.

So, Moodle just needs to go for it and:

  1. Refactor core code to separate form (theme) and function (everything else) - thus removing BS specifics from anywhere but the 'bootstrap' theme folder itself.
  2. Make it happen.

Gareth

Average of ratings: Useful (2)
In reply to Gareth J Barnard

Re: Bootstrap3 for Moodle3.0

by Gavin Henrick -
Picture of Plugin developers

With Moodle 3.0 being the Long Term Supported release, should it not then have at least the latest version possible of Bootstrap at that point - so BS3 since the work has to happen now in coming months.

Adding in BS as another core theme would seem to make most sense right now as it is going to be there for 3 years.

Do you really want to leave BS2 as the core version for those choosing LTS?

Average of ratings: Useful (9)