Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-5672

Ban all use of non-semantic, un-overridable Bootstrap classes like m-x-1

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: Integration
    • Labels:
      None

      Description

      A user reported a bug in our theme, which turned out to be due to the use of the bootstrap class m-x-1 on some element.

      That is implemented as
      .m-x-1

      { margin-left: 14px !important; margin-right: 14px !important; }

      So basically it is impossible to override. This is pretty much as bad as putting style="margin-left: 14px; margin-right: 14px" in the HTML, which would not be allowed. Boostrap docs here: https://getbootstrap.com/docs/4.1/utilities/spacing/

      If the goal of the UI team is to improve Moodle's HTML and CSS, then this has not place n Moodle. We should ban it in the coding style, and make a codechecker rule to detect it.

      Bas Brands

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            timhunt Tim Hunt
            Participants:
            Component watchers:
            Eloy Lafuente (stronk7)
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: