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

Add an initial csslint config

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.7.3, 2.8, 2.9
    • Fix Version/s: 2.7.4, 2.8.2
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide

      (requires *nix based install)

      npm install -g csslint

      In the base of your moodle install:

      1. Run csslint --quiet --format=compact . | grep Error
      2. VERIFY: you can only see errors noted in the expected errors section below
      3. Run csslint --quiet --format=compact . | grep -v Error
      4. VERIFY: the warnings you see generally look sensible, but not overwhelming (considering its the entire codebase)
      Expected errors

      theme/(clean|more)/style/custom.css: IDENT errors
      Caused by our templates in there. Doesn't look to be a away round it except ignoring the whole files. I still think its useful to have these file checked, so we just have to expect the error (cibot will filter them too)

      base/style/course.css: line 576, col 14, Error - Duplicate property '*display' found.
      This looks like its an IE7 workaround to me, not touching for safety. (If anyone ever edits that line they can investigate)
      theme/base/style/filemanager.css: line 21, col 20, Error - Duplicate property 'filter' found
      theme/base/style/filemanager.css: line 21, col 118, Error - Duplicate property 'background' found.
      Looks like more crazy IE stuff, same as above

      Show
      (requires *nix based install) npm install -g csslint In the base of your moodle install: Run csslint --quiet --format=compact . | grep Error VERIFY: you can only see errors noted in the expected errors section below Run csslint --quiet --format=compact . | grep -v Error VERIFY: the warnings you see generally look sensible, but not overwhelming (considering its the entire codebase) Expected errors theme/(clean|more)/style/custom.css: IDENT errors Caused by our templates in there. Doesn't look to be a away round it except ignoring the whole files. I still think its useful to have these file checked, so we just have to expect the error (cibot will filter them too) base/style/course.css: line 576, col 14, Error - Duplicate property '*display' found. This looks like its an IE7 workaround to me, not touching for safety. (If anyone ever edits that line they can investigate) theme/base/style/filemanager.css: line 21, col 20, Error - Duplicate property 'filter' found theme/base/style/filemanager.css: line 21, col 118, Error - Duplicate property 'background' found. Looks like more crazy IE stuff, same as above
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-48277-master

      Description

      CSSLint is a CSS linting tool which can be used to detect errors in CSS as well as enforce standards.

      At this time we do not have CSS guidelines (see MDLSITE-3612) however, the tool still can be of use to spot errors, typos, duplicate rules and this kind of thing.

      We can have these checks run by CiBot (MDLSITE-3612) and so this issue is about enabling an initial config which can be built upon as standards develop.

      Note the elephant in this room is 'less' - makes a lot of this less relevant (haha). But we are still maintaining our own css for base and plugins which still make this a worthwhile exercise (and perhaps more useful because there is less everyday testing going on).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                poltawski Dan Poltawski
                Reporter:
                poltawski Dan Poltawski
                Peer reviewer:
                Sam Hemelryk
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Eloy Lafuente (stronk7)
                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:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Jan/15