Index

CssRule

MMO\client\scs · 1 symbol · generated 30 Sep 2026

class

CssRule

CssRule.php:11

One generated css rule, before emission.

class MMO\client\scs\CssRule
Namespace
MMO\client\scs
A rule carries its emission priority (`@order`), the at-rules it is wrapped in (`@media`, `@supports`, `@keyframes`) -- so [`Emitter`](https://mmoframework.fr/documentation/mmo.client/php/scs/Emitter.md#emitter) can sort and group everything at the very end of the pipeline -- and the source position of its selector and of each declaration, for the source map.

Properties7

declarations

array $declarations = []
Type
array

order

int $order
Type
int

selectors

array $selectors
Type
array

seq

int $seq
Type
int

statement

bool $statement = false
Type
bool

wrappers

array $wrappers
Type
array

Methods6

add($property, $value, $order, $seq, $location)

CssRule.php:32
function add( string $property, string $value, int $order, int $seq, ?MMO\client\scs\SourceLocation $location = null ): void
$propertystring
$valuestring
$orderint
$seqint
$location = nullnull | SourceLocation
returnsvoid

group()

CssRule.php:41
function group(): string
returnsstringthe key identifying the at-rule chain this rule belongs to

sorted()

CssRule.php:44
function sorted(): array
returnsarraythe declarations, sorted by @order then by source order

__construct($selectors, $wrappers, $order, $seq, $location)

CssRule.php:24
function __construct( array $selectors = [], array $wrappers = [], int $order = 0, int $seq = 0, ?MMO\client\scs\SourceLocation $location = null )
$selectors = []arraythe resolved selectors this rule emits
$wrappers = []arraythe at-rules wrapping it, outermost first, ex: ['@media (min-width: 768px)']
$order = 0intthe @order priority, higher is emitted later
$seq = 0intthe creation rank, used to keep the source order within a priority
$location = nullnull | SourceLocationwhere the rule was written, for the source map