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

plugins unable to provide "bootstrapbase" or "clean" styles

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5, 2.6
    • 2.5.5, 2.6.2
    • Themes
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • MDL-41767-master
    • Hide
      1. Locate a theme which as 2 parent themes ($THEME->parents)
      2. In a plugin which defines a styles.css pick a simple rule from the file styles.css
        • Example: .mod_blah h2 { font-size: 13px; }
      3. Creates 3 additional files
        • styles_<parent1>.css
          • Only containing: .mod_blah h2 { font-size: 14px; }
        • styles_<parent2>.css
          • Only containing: .mod_blah h2 { font-size: 15px; }
        • styles_<theme_chosen>.css
          • Only containing: .mod_blah h2 { font-size: 16px; }
      4. Now visit the module you and using FireBug locate the element that you have been styling
      5. Make sure that each of the rules have been used, but only the one from styles_<theme_chosen>.css is effective.
      Show
      Locate a theme which as 2 parent themes ($THEME->parents) In a plugin which defines a styles.css pick a simple rule from the file styles.css Example: .mod_blah h2 { font-size: 13px; } Creates 3 additional files styles_<parent1>.css Only containing: .mod_blah h2 { font-size: 14px; } styles_<parent2>.css Only containing: .mod_blah h2 { font-size: 15px; } styles_<theme_chosen>.css Only containing: .mod_blah h2 { font-size: 16px; } Now visit the module you and using FireBug locate the element that you have been styling Make sure that each of the rules have been used, but only the one from styles_<theme_chosen>.css is effective.
    • FRONTEND Sprint 10

    Description

      Given the mod_grrr contrib plugin (or subplugin) as example, right now it's possible to specify a custom css sheet:

      mod/grr/styles.css

      And also it's possible to specify custom css by current theme (assume standard):

      mod/grrr/styles_standard.css

      The 1st is used everywhere (both in core and contrib plugins). And the 2nd is way less common, but still has a point in some rare situations.

      But it's impossible to point to the parent themes so this does not work:

      mod/grrr/styles_base.css

      With the arrival of the "base" and "bootstrapbase" duality in 2.5, and more if the later is going to become the "default" one… we need to be able to specify any of these, per plugin:

      • mod/grrr/styles.css (to be applies to all themes)
      • mod/grrr/styles_base.css (to be applied to all "base" themes)
      • mod/grrr/styles_bootstrapbase.css (to be applied to all "bootstrapbase" themes)
      • mod/grrr/styles_standard.css (to be applies to "standard", and any "child" of it.
      • mod/grrr/styles_clean.css (to be applied to "clean", and any "child" of it).

      I other words, we need to add support to parent themes in css_files() also for plugins, if I'm not wrong. Right now only the "current" theme is supported. We should be looking for the existence of any parent there.

      That's the only way I can imagine to keep things organized. Right now we are using a modules.less (and .css) in bootstrapbase but it has 2 limitations:

      1) It only works for core plugins.
      2) It is against the whole organization of plugins (self-contained).

      So this is about to implement and document the support of parent themes css for plugins.

      Ciao

      Attachments

        Issue Links

          Activity

            People

              fred Frédéric Massart
              stronk7 Eloy Lafuente (stronk7)
              Damyon Wiese Damyon Wiese
              David Monllaó David Monllaó
              Huong Nguyen, Bas Brands, Mathew May
              Votes:
              2 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10/Mar/14