Hi folks,
I've got a custom Moodle theme which is basically Boost with some navigation tweaks and a few accessibility options added.
One of the accessibility options loads a custom dyslexia-friendly webfont. We do this using a CSS file to load the web font, then adding a class to the body tag to use web web font. We load the CSS file through $THEME->sheets[].
@font-face { font-family: 'OpenDyslexic'; src: url([[font:theme|dyslexic-r.woff]]) format('woff')); font-weight: 400; font-style: normal; }
body.hillhead-font-dyslexic, .accessibility-tools .switch-to-dyslexic-font { font-family: "OpenDyslexic", "Helvetica", "Arial", sans-serif; }
We've used this approach in our theme for years. It has worked in Moodle 3.3, 3.5, 3.7, 3.8 and 3.9. But it's not working in Moodle 3.10 - everything's in plain old Helvetica.
Using my browser's web inspector tool, I can see that the CSS is loading and the correct body class is applied. There's no debugging output in the logs, and nothing logged in the browser's console. I've also taken a look at /theme/upgrade.txt and there's nothing exciting in there.
I'm vaguely aware that Bootstrap has changed how it handles fonts. If I inspect something on the page and look at the computed CSS, I'm seeing font-family-sans-serif instead of the old font-family.
I'll admit, my CSS skills were top of the game back in 2010 and the Bootstrap 2 era, but a lot has changed since then and I haven't kept up as much as I'd like - new job with different responsibilities etc. If anyone with their finger on the pulse of Moodle theme development could give me a pointer in the right direction, I'd really appreciate it. Google isn't showing anything recent or helpful, and is full of basic "how to use custom webfonts in Bootstrap" articles from 2014.