Index

Result

MMO\client\scs · 1 symbol · generated 5 Oct 2026

class

Result

Result.php:14

The outcome of a compilation: the generated css, plus the compile-time variables it evaluated.

class MMO\client\scs\Result implements Stringable
Namespace
MMO\client\scs
Implements
Stringable
The extracted values are compile-time data -- they are *not* css custom properties (`the` spec, 48B.7), which is exactly what makes them useful to an application that needs the same number the stylesheet used.
$result = SCSCompiler::Shared()->compileText($source, ['density' => 2]); echo $result->css(); $result->phpValue('spacing'); // '16px'

Properties4

css

protected string $css
Type
string

themes

protected array $themes
Type
array

values

protected array $values
Type
array

Methods8

map()

Result.php:56
function map(): ?MMO\client\scs\SourceMap
returnsnull | SourceMapwhere every selector and declaration came from, null when no map was asked for
file_put_contents('app.css.map', $result->map()->toJson());

phpValue($name)

Result.php:42
function phpValue(string $name): mixed
$namestring
returnsmixedthe variable as plain php ('16px', 2, ['a', 'b'], ...)

themes()

Result.php:50
function themes(): array
returnsarraythe declared design tokens: scope => [dotted path => Value]

value($name)

Result.php:34
function value(string $name): ?MMO\client\scs\Value
$namestringthe variable name, with or without its $
returnsnull | Valuenull when the stylesheet never declared it

values()

Result.php:47
function values(): array
returnsarrayevery compile-time variable left in the global scope

__construct($css, $values, $themes, $map)

Result.php:21
function __construct( string $css, array $values = [], array $themes = [], ?MMO\client\scs\SourceMap $map = null )
$cssstring
$values = []arraycompile-time variable name (without the $) => value
$themes = []arraytheme scope => [dotted path => Value]
$map = nullnull | SourceMapthe source map, when the compilation was asked for one