Microthemer conflict with Livecanvas plugin and Pictostrap theme

Author Posts

vikasg1970

I am testing Microthemer with Live Canvas and its compatible theme which is Pictostrap. The theme is based on Bootstrap besides Live Canvas also runs on Bootstrap. As you might be aware that for margin top Bootstrap uses mt-o to mt-5 classes. Besides Live canvas has its own mt-6 to mt-8 classes for margin top.
The problem is that Microthemer also inserts one class with the page-id + prefix mt in the Body Class. So, if the page id is 5 microthemer will insert the class mt-5 in the body class. This inserts a margin of 48px on top of the page. and if the page-id is 8 microthemer will insert class of mt-8 which inserts a huge margin of 384pxl on top of the page. So, is it possible in microthemer, that a user can insert a prefix before the mt class of microthemer, so that such type of conflicts can be avoided.


Sebastian

Hey,

Thanks for raising this. Someone recently reported a similar issue with tailwind, which also uses the same mt-x convention.

One quick fix I suggested was to add the following selector in Microthemer to override this behaviour on the body tag:

body[class*="mt-"] {
margin-top: 0px;
}

But I could also make the mt- prefix configurable in the Preferences if that would be a better solution for you?

Cheers,
Sebastian


vikasg1970

Thanks Sebastian,
Adding the code worked. Now there is no margin. But adding a prefix before the mt class like xx-mt-7 will be beneficial, as it may remove the possiblities of conflicts, since there are many themes coded with Bootstrap and Tailwind css.
So, I request if possible, in the PREFRENCES, you can include a checkbox or radio button, which if selected brings an input field, where the user can insert a prefix before the mt class.
Thanks once again for the quick solution.


Sebastian

Sure thing, if it’s not urgent I will include the new config option in MT version 7, which I’m working on right now.

Cheers,
Sebastian


vikasg1970

Thanks Sebastian,
It is not urgent. You need not disturb your development workflow. You can include it in MT Version 7.
I am eagerly waiting for Version 7 of MT.

Regards

You must login or register to reply to this topic.