An idea for a new breed of Bootstrap(3) themes

An idea for a new breed of Bootstrap(3) themes

Mary Evans發表於
Number of replies: 8

Since Bootstrapbase is written using Bootstrap(2) would it not be possible to divide bootstrapbase/less files into compartments whereby we could update the Bootstrap elements and still use all of Moodle core less files?

Basically what I am trying to say is take out of Moodle less files anything to do with Bootstrap. That way any theme could use the compiled CSS which would style the main elements of Moodle, in much the same way that course/style.css should style all the elements to do with course pages in Moodle.

The bootstrap less directory could then be further partitioned to include the different versions of Bootstrap 2, 3, 4 , ... ad infinitum... so that any theme could pick and choose which version of Bootstrap to use?

Or would all this cause the Moodle server to burp and die...

Just another crazy idea byLazyDaisy or should that be CrazyDaisy cheers

評比平均分數:Useful (1)
In reply to Mary Evans

Re: An idea for a new breed of Bootstrap(3) themes

Gareth J Barnard發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片

Sounds like a plan when you compare the top of https://github.com/moodle/moodle/blob/master/theme/bootstrapbase/less/moodle/core.less and https://github.com/bmbrands/theme_bootstrap/blob/master/less/moodle/core.less.  I wonder how much there actually is?  Could be quite small.  But... as I've found with MDL-43112, changing the code is easy, writing the test to demonstrate that nothing was harmed in the process or that an icon moving one pixel to the left is ok, is the hard part.  Therefore, despite the process of changing the LESS might be easy, writing the test plan to demonstrate that all of the screens that could be affected are 'not' is the issue.  Unless there is a leap of faith that the improvement is logical and any 'pixel' issues can be rectified in release testing, where 'personpower' is utilised to check everything.

However... In reality what needs to happen is to reduce the amount of CSS in the first place, down to a more manageable less granular, component based set of reusable entities.  But leave specific classes in if theme designers want to target 'this' or 'that' pixel where no other means of selector specification would work.  Less is more when there is a reduction in the quantity of code and therefore amount of test coverage required.

Reduce, refactor, improve.  Simples!

In reply to Gareth J Barnard

Re: An idea for a new breed of Bootstrap(3) themes

Mary Evans發表於

Hi Gareth, 

I think that the actual amount of bootstrap CSS which are basically modified CSS fixes tha undo Bootstrap CSS so that it fits in with Moodle.

However given that Bootstrap CSS covers most HTML basic structures of a web page like tables and form and also given that most the elements in Moodle CORE are styled in the element styles.css themselves one does have to wonder why does Bootstrapbase need so much of base themes CSS? 

I recall David Scotson asking a similar question and also recall that he tested Bootstrapbase to see what it looked like without Moodle core CSS and fount it looked and worked ok for the majority of the various elements.

Perhaps we need to think about this before Moodle 3 or else the old ways of styling will infiltrate Moodle/bootstrap and be a total washout, thinking of the mess trying to cleanup iconsmall and smallicon to icon-small !!! 

Mary

評比平均分數:Useful (1)
In reply to Mary Evans

Re: An idea for a new breed of Bootstrap(3) themes

Gareth J Barnard發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片

Hi Mary,

Oh, I thought that the 'less/moodle' files applied styles on top of bootstrap to allow the application of bootstrap styles to moodle granular components.  So not an undo process but rather an add and partial merge, like an 'outer join' or a fully coloured in venn diagram with two entities.

This https://github.com/bmbrands/theme_bootstrap/issues/259 is worth a read as I've commented about file sizes.

Perhaps the approach is a 'bootstrap' first one as David suggests.  Use Bootstrap then apply styles in 'less/moodle' as needed.

However, I'm still convinced that the Moodle styles are too bloated and granular.  There needs to be a finite set of design components that are applied consistently and remove the notion of needing / being capable of styling every single grain of sand on the beach.  Then it would be easier to integrate other frameworks and cope with change.  Because one thing is certain in computing is that change is constant and being static only leads to demise.

Cheers,

Gareth

評比平均分數:Useful (1)
In reply to Gareth J Barnard

Re: An idea for a new breed of Bootstrap(3) themes

Mary Evans發表於

Indeed! I could not agree more.

Cheers

Mary

PS: On another note altogether...sorry for typos in my last post, it's because i was using my iPad which seems to have a mind of its own! LOL

In reply to Mary Evans

Re: An idea for a new breed of Bootstrap(3) themes

Bas Brands發表於
Core developers的相片 Peer reviewers的相片 Plugin developers的相片 Plugins guardians的相片 Testers的相片

Hi Mary,

That would be a great idea! I would love to be able to simply pull in any framework I like and combine it with moodle less files.

Before that is even possible Moodle css and html would need to be broken down into components or atoms which would allow us to apply framework styling to them. With MDL-36558 being discussed it looks like this could already be in Moodle 2.8. It would be a major change in Moodle but essential to making the front-end manageable.

So basically we could have some markup like this:

<div class ="forum-post">
<div class = "forum-title">
<a href="userpage><img class="profilepic">pic
<a>
<div class="bd">
</div>
</div>
...
</div>

 Where we can link framework classes in less.

.forum-post {
    .panel .panel-default;
}
.forum-title {
.panel-heading;
.media-box;
}

The hard part would be to identify all different components in Moodle and allow them to be re-used in many different contexts.

This video  on Style Guide Driven development posted by David describes a project much like Moodle where they have redesigned both the front end and back end of a webapp. So in concluding. With a nice elementlibrary that is independent of a css framework we would need less HTML, CSS and testing to make cool themes and plugins.
 

 

評比平均分數:Useful (1)
In reply to Bas Brands

Re: An idea for a new breed of Bootstrap(3) themes

Mary Evans發表於

Cheers

I can see you have been reading SMACSS by Jonathan Snook

what is exciting about this is that it is possible!

thanks

Mary

In reply to Bas Brands

Re: An idea for a new breed of Bootstrap(3) themes

Gareth J Barnard發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片

I think this earlier post I made is relevant to this post: https://moodle.org/mod/forum/discuss.php?d=258378

In reply to Gareth J Barnard

Re: An idea for a new breed of Bootstrap(3) themes

Mary Evans發表於

I had another mad idea today, that of making all MOODLE modular elements work 'out of the box' in that they be styled internally, all using the same format of headings, form types and encased in a box.

Lets face it, I think it is fair to say that most of the Moodle modular elements do this anyhow, but sadly the greater part of the CSS is in two distinct and different themes. Base and Bootstrapbase, and yet most of this css is identical.

If this "common denominator CSS" were divided amongst the relevant styles.css within the various 'modules' to achieve the structure of Moodle we want, then themes could be freed up to style those theme related elements the way the theme designer wants them to look and work.