Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402]

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: 208 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