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

SCSS PHP compiler does not support the '@import url' at-rule.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • 3.2.1
    • HTML and CSS, Themes
    • MOODLE_32_STABLE
    • Hide

      Edit the 'head' section of the theme layout / mustache template files and add a 'style' tag with the '@import' statement.

      Show
      Edit the 'head' section of the theme layout / mustache template files and add a 'style' tag with the '@import' statement.
    • Hide
      1. Download the 'United' preset scss files from: https://bootswatch.com/.
      2. Use the 'import-bootswatch.php' to make a preset contained within the '/theme/boost/cli/' folder. Read 'readme_moodle.txt' within that folder for more information.
      3. Upload the preset on 'Site administration -> Appearance -> Themes -> Boost' - 'General settings' tab.
      4. Set the preset on the same tab.
      5. Observe that the preset has been parsed and applied.
      Show
      Download the 'United' preset scss files from: https://bootswatch.com/ . Use the 'import-bootswatch.php' to make a preset contained within the '/theme/boost/cli/' folder. Read 'readme_moodle.txt' within that folder for more information. Upload the preset on 'Site administration -> Appearance -> Themes -> Boost' - 'General settings' tab. Set the preset on the same tab. Observe that the preset has been parsed and applied.

      With reference to: https://moodle.org/mod/forum/discuss.php?d=346241 the PHP SCSS compiler fails to parse "@import url('')" at-rule statements. It fails with a stack trace:

      [05-Feb-2017 13:39:46 Europe/London] PHP Notice:  Array to string conversion in F:\moodledev\moodle32\lib\scssphp\Compiler.php on line 2727
       
      [05-Feb-2017 13:39:46 Europe/London] Default exception handler: Exception - unknown value type: Array: line: 7 Debug: 
       
      Error code: generalexceptionmessage
      * line 3418 of \lib\scssphp\Compiler.php: Leafo\ScssPhp\Exception\CompilerException thrown
      * line 2727 of \lib\scssphp\Compiler.php: call to Leafo\ScssPhp\Compiler->throwError()
      * line 2756 of \lib\scssphp\Compiler.php: call to Leafo\ScssPhp\Compiler->compileValue()
      * line 115 of \lib\classes\scss.php: call to Leafo\ScssPhp\Compiler->compileStringContent()
      * line 1274 of \lib\scssphp\Compiler.php: call to core_scss->compileChild()
      * line 295 of \lib\scssphp\Compiler.php: call to Leafo\ScssPhp\Compiler->compileChildrenNoReturn()
      * line 194 of \lib\scssphp\Compiler.php: call to Leafo\ScssPhp\Compiler->compileRoot()
      * line 98 of \lib\classes\scss.php: call to Leafo\ScssPhp\Compiler->compile()
      * line 1216 of \lib\outputlib.php: call to core_scss->to_css()
      * line 884 of \lib\outputlib.php: call to theme_config->get_css_content_from_scss()
      * line 171 of \theme\styles.php: call to theme_config->get_css_content()
      

      where in this case 'Array: line 7' was a line in a Boost scss preset. But you will get a similar error wherever you put the code and its then parsed.

      Refs:
      https://developer.mozilla.org/en/docs/Web/CSS/[~imported]
      https://github.com/sass/libsass/issues/289

            Unassigned Unassigned
            gb2048 Gareth J Barnard
            Votes:
            9 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved:

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