Mezuen egilea: David Scotson

Moodle in English -> General developer forum -> css Calc() problem -> Re: css Calc() problem

David Scotson -

There's some workarounds listed in the bug tracker commemts for MDL-61879 and it seems the issue is now fixed in the CSS parser library that Moodle uses, so upgrading that is probably a solution if you have that kind of server access.



It should be possible to create a subset of the popular bootstrap classes used in Moodle content and add them to the app so that your example "just works" as it is. I think it could be done via the same mechanism that lets you change the colours of the app by providing a link to a CSS file so someone could work on this without needing to convince the mobile app developers it was a good idea.

It is.a reasonable amount of development though, and it seems no-one has done that up front work yet to make this possible.

Complications include the fact that the mobile framework has seperate styles for different platforms, and the mobile app is transitioning between two versions, though you can provide different styles for each version. So making it all work seamlessly for all platforms and all possible bootstrap classes is a big job.

But incremental progress is possible. So just copying and pasting the standard Bootstrap CSS for .btn and .btn-default into a CSS file somewhere and pointing the mobile app to it in settings would at least make these links "button-y" and people could build from there to make them more native looking or add other popular classes like badges or alerts.

I think I reported a related issue, it was to do with the way the class names for "fake" blocks, previously code set the extra class, much in the same way as the bug described in this thread, this then got thrown away by the template.

More details here:

https://tracker.moodle.org/browse/MDL-59037

I also found a previous submission of this current bug:

https://tracker.moodle.org/browse/MDL-58315

So one should be closed as a dupe probably.

Hi,


this seems like it might be a DB issue caused during the backup/restore process.

I think to fix it you'd need to change the 'visible' column in the 'course_sections' table directly.

I don't think it's a Snap-specific issue, as if it is the DB at fault then I'd guess other themes will have similar glitches when they try to use that data (though obviously they don't have the TOC so it won't present itself in exactly the same way).

Worth noting, when I recreated this by changing the DB directly I didn't see any change until the modinfo cache got refilled, by e.g. hiding/unhiding a different section.
You can probably do part of this just by setting some Sass variables, $nav-tabs-active-link-hover-color perhaps:

bootstrap/_variables.scss
507:$nav-tabs-border-color: #ddd !default;
508:$nav-tabs-border-width: $border-width !default;
509:$nav-tabs-border-radius: $border-radius !default;
510:$nav-tabs-link-hover-border-color: $gray-lighter !default;
511:$nav-tabs-active-link-hover-color: $gray !default;
512:$nav-tabs-active-link-hover-bg: $body-bg !default;
513:$nav-tabs-active-link-hover-border-color: #ddd !default;
514:$nav-tabs-justified-link-border-color: #ddd !default;
515:$nav-tabs-justified-active-link-border-color: $body-bg !default;

Generally speaking, when trying to change some CSS, you should use the browser tools to look at the current CSS that is setting the value that you want to change. Moodle often has long and very specific selectors which are a problem, because any rule that wants to overrule them needs be even longer and more specific, or else it will get overruled.