ScssCompiler
extends AbstractCssPreCompiler
in package
Class to compile SCSS into CSS within a theme.
Tags
Table of Contents
- $basePath : string
- Base path of VuFind.
- $fakePath : string
- Fake base path used for generating absolute paths in CSS.
- $output : OutputInterface
- Output object (set for logging)
- $tempPath : string
- Temporary directory for cached files.
- $themeConfigKey : string
- Key in theme.config.php that lists all files
- __construct() : mixed
- Constructor
- compile() : void
- Compile the scripts.
- setBasePath() : void
- Set base path
- setTempPath() : void
- Set temporary directory
- getAllFiles() : array<string|int, mixed>
- Get all less files that might exist in a theme.
- getAllThemes() : array<string|int, mixed>
- Get a list of all available themes.
- logMessage() : void
- Log a message to the console
- makeRelative() : string
- Convert fake absolute paths to working relative paths.
- processTheme() : void
- Compile scripts for the specified theme.
Properties
$basePath
Base path of VuFind.
protected
string
$basePath
$fakePath
Fake base path used for generating absolute paths in CSS.
protected
string
$fakePath
= '/zzzz_basepath_zzzz/'
$output
Output object (set for logging)
protected
OutputInterface
$output
$tempPath
Temporary directory for cached files.
protected
string
$tempPath
$themeConfigKey
Key in theme.config.php that lists all files
protected
string
$themeConfigKey
= 'scss'
Methods
__construct()
Constructor
public
__construct([OutputInterface $output = null ]) : mixed
Parameters
- $output : OutputInterface = null
-
Output interface for logging (optional)
Return values
mixed —compile()
Compile the scripts.
public
compile(array<string|int, mixed> $themes) : void
Parameters
- $themes : array<string|int, mixed>
-
Array of themes to process (empty for ALL themes).
Return values
void —setBasePath()
Set base path
public
setBasePath(string $path) : void
Parameters
- $path : string
-
Path to set
Return values
void —setTempPath()
Set temporary directory
public
setTempPath(string $path) : void
Parameters
- $path : string
-
Path to set
Return values
void —getAllFiles()
Get all less files that might exist in a theme.
protected
getAllFiles(string $theme) : array<string|int, mixed>
Parameters
- $theme : string
-
Theme to retrieve files from
Return values
array<string|int, mixed> —getAllThemes()
Get a list of all available themes.
protected
getAllThemes() : array<string|int, mixed>
Return values
array<string|int, mixed> —logMessage()
Log a message to the console
protected
logMessage(string $str) : void
Parameters
- $str : string
-
message string
Return values
void —makeRelative()
Convert fake absolute paths to working relative paths.
protected
makeRelative(string $css, string $less) : string
Parameters
- $css : string
-
Generated CSS
- $less : string
-
Relative LESS filename
Tags
Return values
string —processTheme()
Compile scripts for the specified theme.
protected
processTheme(string $theme) : void
Parameters
- $theme : string
-
Theme name