Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-65904

CSS fallback uses parents in incorrect order

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.4, 3.7
    • Fix Version/s: 3.6.5, 3.7.1
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide

      This can be tested just with Classic and Boost, although it is a bit subtle.

      1. Go to Setup a test site and select Classic as the active theme.
      2. Go to the Users dashboard, confirm that the dashboard is made of grey cards on a white background.
      3. Go to the Classic settings (Site Admin > Appearance > Themes > Classic.
      4. Go to the Advanced tab.
      5. In Raw initial SCSS enter $foo: $bar;
      6. Save. If you have debugging on, you should see a "Error while compiling SCSS" message in your PHP log. The error will not display in browser.
      7. Go back to the user dashboard.
      8. Reload (Sometimes an additional page reload is needed to get the latest CSS, unrelated to this issue).
      9. Confirm that the dashboard is made of grey cards (blocks) on a white background.
        • The old behavior would have resulted in there being white cards on a gray background, which is the Boost aesthetic.
      Show
      This can be tested just with Classic and Boost, although it is a bit subtle. Go to Setup a test site and select Classic as the active theme. Go to the Users dashboard, confirm that the dashboard is made of grey cards on a white background. Go to the Classic settings (Site Admin > Appearance > Themes > Classic. Go to the Advanced tab. In Raw initial SCSS enter $foo: $bar; Save. If you have debugging on, you should see a "Error while compiling SCSS" message in your PHP log. The error will not display in browser. Go back to the user dashboard. Reload (Sometimes an additional page reload is needed to get the latest CSS, unrelated to this issue). Confirm that the dashboard is made of grey cards (blocks) on a white background. The old behavior would have resulted in there being white cards on a gray background, which is the Boost aesthetic.
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65904-master

      Description

      If using precompiledcsscallback in a child theme of a parent that also implements it, the parent's fallback css will effectively override the child css.

      This is because the the theme_config->get_precompiled_css_content() stitches the CSS files together in child + parents order, resulting in parents CSS being lower in the CSS, hence taking higher priority for identical specificity.

      As other areas of the lib do, it should be in array_reverse(parents) + child order.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerrill Eric Merrill
                Reporter:
                emerrill Eric Merrill
                Peer reviewer:
                Ryan Wyllie
                Integrator:
                Jake Dallimore
                Tester:
                Anna Carissa Sadia
                Participants:
                Component watchers:
                Bas Brands, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 10 minutes
                  2h 10m