Morecandy and buttons

Morecandy and buttons

by Andy Chaplin -
Number of replies: 5

Hi all (and particularly Mary!)

I'm using the latest version of Morecandy on both a 2.9 and a 3.0 moodle site and have the same problem with both.  When I try to create Bootstrap buttons, they all seem to come out the same size - small.

It doesn't matter whether I use btn-sm or btn-lg or btn-xs, all the buttons seem to be displayed as btn-sm.

I've checked this on a blank html page (outside of Moodle) and they display correctly.

Have I missed something obvious, or is there something in the theme which overrides this?

Thanks for any pointers,


Andy

Average of ratings: -
In reply to Andy Chaplin

Re: Morecandy and buttons

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

You need

.btn-large, .btn-small, or .btn-mini.

for BS2

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

Re: Morecandy and buttons

by Andy Chaplin -

Thanks for tip guys!

As a follow-up question, I changed the tag and it worked fine.  I'm thinking about future-proofing my code snippets though and wondered if it is good practice to put both codes in - btn-xs btn-mini - it seems to work fine.  Did I get lucky?  Or will this save me time later if the theme gets updated to BS3, or I switch to a BS3 theme?

I'm trying to avoid creating a mess for myself later.

Again, your wisdom is much appreciated!


Andy


In reply to Andy Chaplin

Re: Morecandy and buttons

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

For some things you can certainly do that - I did it previously for some simple work with BS grids. Obviously some BS3 code doesn't have a duplicate in BS2 and vice-versa and anything that makes use of hte javascript could also be a potential issue, but some of the simpler code snippets can certainly be made compatible across both versions.

However, if you do that I would strongly advise having a BS3 theme on your system to test it out (even if its just Bas' bootstrap itself) as there may be some bits of BS code that do not duplicate that cleanly and its worth testing just in case.

Average of ratings: Useful (1)
In reply to Andy Chaplin

Re: Morecandy and buttons

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

Hi Andy,

Since CSS is relatively easy to add you could try making up a stylesheet with all the BS3 components that you like, such as the button styles. Then once the CSS is in place you can use the BS3 css selectors that will make them work.

As I see it BS3 could just as well be an extension to BoostrapBase.

We are in a situation now like we were in Moodle 2.1/2/3/4 where every theme built used a different layout than that which was in Base theme. In fact hardly anyone bothered to use Base theme's layouts mainly because the CSS was different and not that easy to fathom to tell the truth and few people to this day have no idea how to calculate it.

If the LESS files in bootstrapbase was grouped into smaller packets we could easily isolate the layouts and substitute with any other CSS

Cheers

Mary

Average of ratings: Useful (2)