Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
core_scss Class Reference

Moodle SCSS compiler class. More...

Inheritance diagram for core_scss:

Public Member Functions

 add_variables (array $variables)
 Add variables.
 
 append_raw_scss ($scss)
 Append raw SCSS to what's to compile.
 
 compile ($code, $path=null)
 Compile scss.
 
 prepend_raw_scss ($scss)
 Prepend raw SCSS to what's to compile.
 
 set_file ($filepath)
 Set the file to compile from.
 
 to_css ()
 Compiles to CSS.
 

Protected Member Functions

 compileChild ($child, ScssPhp\ScssPhp\Formatter\OutputBlock $out)
 Compile child; returns a value to halt execution.
 
 is_valid_file ($path)
 Is the given file valid for import ?
 

Protected Attributes

array $scsscontent = array()
 Bits of SCSS content.
 
string $scssfile
 The path to the SCSS file.
 
array $scssprepend = array()
 Bits of SCSS content to prepend.
 

Detailed Description

Moodle SCSS compiler class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ add_variables()

core_scss::add_variables ( array $variables)

Add variables.

Parameters
array$scssAssociative array of variables and their values.
Return values
void

◆ append_raw_scss()

core_scss::append_raw_scss ( $scss)

Append raw SCSS to what's to compile.

Parameters
string$scssSCSS code.
Return values
void

◆ compile()

core_scss::compile ( $code,
$path = null )

Compile scss.

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

Parameters
string$codeSCSS to compile.
string$pathPath to SCSS to compile.
Return values
stringThe compiled CSS.

◆ compileChild()

core_scss::compileChild ( $child,
ScssPhp\ScssPhp\Formatter\OutputBlock $out )
protected

Compile child; returns a value to halt execution.

Parameters
array$child
ScssPhp\ScssPhp\Formatter\OutputBlock$out
Return values
array|null

◆ is_valid_file()

core_scss::is_valid_file ( $path)
protected

Is the given file valid for import ?

Parameters
$path
Return values
bool

◆ prepend_raw_scss()

core_scss::prepend_raw_scss ( $scss)

Prepend raw SCSS to what's to compile.

Parameters
string$scssSCSS code.
Return values
void

◆ set_file()

core_scss::set_file ( $filepath)

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.

Parameters
string$filepathThe path to the file.
Return values
void

◆ to_css()

core_scss::to_css ( )

Compiles to CSS.

Return values
string

The documentation for this class was generated from the following file: