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

CSS fallback uses parents in incorrect order

    XMLWordPrintable

Details

    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-65904-master
    • 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.

    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

              emerrill Eric Merrill
              emerrill Eric Merrill
              Ryan Wyllie Ryan Wyllie
              Jake Dallimore Jake Dallimore
              Anna Carissa Sadia Anna Carissa Sadia
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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

                  Clockify

                    Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.