Skip to content

Remove external CSS dependencies from Parsons iframe and use Moodle theme styles#1694

Open
bpinger wants to merge 1 commit intomaths:masterfrom
bpinger:master
Open

Remove external CSS dependencies from Parsons iframe and use Moodle theme styles#1694
bpinger wants to merge 1 commit intomaths:masterfrom
bpinger:master

Conversation

@bpinger
Copy link

@bpinger bpinger commented Mar 6, 2026

Problem

The Parsons iframe styling relied on externally loaded and outdated CSS dependencies. This introduced unnecessary CDN dependencies and could lead to inconsistencies with the active Moodle theme.

Solution

  • removed external Bootstrap and Font Awesome CSS imports from the sortable stylesheet
  • updated the Parsons iframe rendering logic to use Moodle theme-provided styles instead
  • synced the minified CSS with the source stylesheet changes

Testing

Tested with:

  • Moodle 4.5
  • Union Boost Theme

Verified:

  • Parsons blocks still render correctly in the iframe
  • icons and layout are displayed correctly
  • no external CSS dependencies are required anymore
  • rendering remains consistent with the Moodle theme

@sangwinc
Copy link
Member

sangwinc commented Mar 6, 2026

Thanks @bpinger for pointing this out, and so helpfully suggesting a fix. We'll merge this into "dev" (rather than master) for testing and the next release once I've had a chance to review it.

@jcopado could you have a look at this proposed change and check it's not problematic at your end?

We already refer to the global $PAGE elsewhere, e.g. here: https://github.com/maths/moodle-qtype_stack/blob/master/stack/cas/castext2/blocks/iframe.block.php#L99

One way or another, we will bring this in-house as you suggest.

@EJMFarrow
Copy link
Collaborator

Hi @bpinger - thank you! I'm having trouble testing this, though. I'm getting CORS errors with the fonts.

Hacking https://github.com/moodle/moodle/blob/MOODLE_405_STABLE/theme/font.php to include header('Access-Control-Allow-Origin: *'); fixes it but that's obviously not ideal. It may be my local set up is screwy but I'm wondering if your server is setup to always allow cross origin?

Screenshot 2026-03-11 121612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants