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

Remove !important from modchooser CSS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: Themes
    • Labels:
    • Affected Branches:
      MOODLE_23_STABLE

      Description

      Follow on from MDL-33482

      Some !important rules have come into play. The solution is probably similar to that in MDL-33218.

      Sam H is the guru here, and so I quote from another issue on why its important (geddit!):
      "Umm !important is really bad (well to the world of theme development at least)

      There has to be a better solution than introducing more !important rules in the base theme.
      We've used them presently only in situations where there has been no other viable solution (of the 4 users in base presently 1 is for ie6 and 2 are for RTL YUI bugs). It would be a shame to start introducing more now.
      They represent a theme nightmare, in order for people to customise things they must recognise that !important rules are being applied and also apply them, in the long run can lead to serious confusion and uncontrollable CSS (because !important is everywhere and there is no way to force things anymore).
      !important is designed to give priority to a CSS selector against its natural order of inheritance, it doesn't mean we should use it to force things, in fact really its better we don't use them at all so that themers if they feel the need can to introduce rules that would not otherwise have priority but still have them applied because through use of !important.
      Certainly my +1 goes to removing all of these new !important rules and correcting the CSS. This will help keep our theme's maintainable in the long run, and help keep things easier for theme developers... unless there is a good reason to keep them I havn't studied it, just noticed the !important properties creeping in."

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: