Emitter
MMO\client\scs · 1 symbol · generated 5 Oct 2026
Emitter
Emitter.php:14Collects the generated CssRule and turns them into css: resolves @order, groups the rules of a same at-rule (@media, @supports, @keyframes) together and formats the output.
- Namespace
MMO\client\scs- See
SourceMaprecord where each selector and each declaration came from, as they are emitted.
Index
| column | ||
| line | ||
| map | ||
| out | the css being written, and where the next character will land in it | |
| rules | ||
| sequence | ||
| mark($location) | Record that what is about to be written comes from this source position. | |
| next() | ||
| rule($selectors, $wrappers, $order, $location) | Create and register a rule. | |
| rules() | ||
| toCss($indent, $minify, $optimize, $map) | ||
| write($text) | Append css, keeping track of where the next character lands -- the source map is built from these positions. | |
| writeGroup($wrappers, $rules, $indent, $minify) | ||
| writeRule($rule, $indent, $minify, $depth) |
Properties6
column
- Type
- int
line
- Type
- int
map
out
the css being written, and where the next character will land in it
- Type
- string
rules
- Type
- array
sequence
- Type
- int
Methods8
mark($location)
Emitter.php:111Record that what is about to be written comes from this source position.
| $location | null | SourceLocation | |
| returns | void |
next()
Emitter.php:39| returns | int | the next emission rank, used to keep the source order |
rule($selectors, $wrappers, $order, $location)
Emitter.php:32Create and register a rule.
rules()
Emitter.php:42| returns | array | every registered rule, empty ones included |
toCss($indent, $minify, $optimize, $map)
Emitter.php:51| $indent = ' ' | string | the indentation of one level |
| $minify = false | bool | true to emit compact css |
| $optimize = false | bool | true to merge duplicated selectors and drop overridden declarations |
| $map = null | null | SourceMap | filled, while emitting, with where each selector and declaration came from |
| returns | string | the generated css |
write($text)
Emitter.php:95Append css, keeping track of where the next character lands -- the source map is built from these positions.