Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

Moodle implementation of SCSS.

Copyright: 2016 Frédéric Massart
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 203 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_scss:: (8 methods):
  add_variables()
  append_raw_scss()
  prepend_raw_scss()
  set_file()
  to_css()
  compile()
  compileChild()
  is_valid_file()


Class: core_scss  - X-Ref

Moodle SCSS compiler class.

add_variables(array $variables)   X-Ref
Add variables.

param: array $scss Associative array of variables and their values.
return: void

append_raw_scss($scss)   X-Ref
Append raw SCSS to what's to compile.

param: string $scss SCSS code.
return: void

prepend_raw_scss($scss)   X-Ref
Prepend raw SCSS to what's to compile.

param: string $scss SCSS code.
return: void

set_file($filepath)   X-Ref
Set the file to compile from.

The purpose of this method is to provide a way to import the
content of a file without messing with the import directories.

param: string $filepath The path to the file.
return: void

to_css()   X-Ref
Compiles to CSS.

return: string

compile($code, $path = null)   X-Ref
Compile scss.

Overrides ScssPHP's implementation, using the SassC compiler if it is available.

param: string $code SCSS to compile.
param: string $path Path to SCSS to compile.
return: string The compiled CSS.

compileChild($child, \ScssPhp\ScssPhp\Formatter\OutputBlock $out)   X-Ref
Compile child; returns a value to halt execution

param: array $child
param: \ScssPhp\ScssPhp\Formatter\OutputBlock $out
return: array|null

is_valid_file($path)   X-Ref
Is the given file valid for import ?

param: $path
return: bool