API Reference
Master CSS Core
The core syntax parsing of Master CSS.
Create a Master CSS instance with your custom configuration:
import MasterCSS from '@master/css' const css = new MasterCSS(config)
.config
The .config
property is the result of extending the default config with the custom config you passed by the constructor.
Default | { … } |
---|---|
Type |
css.config
.text
This .text
getter returns the result of joining the text of all CSS rules.
Default | '' |
---|---|
Type | string |
css.text
.add()
Add a new syntax class.
Argument | Type | Default |
---|---|---|
...classNames | string[] | - |
return | boolean | - |
css.add('text:center', ...)
.delete()
Remove an existing syntax class.
Argument | Type | Default |
---|---|---|
...classNames | string[] | - |
return | boolean | - |
css.delete('text:center', ...)
.refresh()
Refresh the Master CSS with the configuration.
Argument | Type | Default |
---|---|---|
config? | this.customConfig | |
return | this | - |
css.refresh(config)
.reset()
Clear all rules and reset to initial.
Argument | Type | Default |
---|---|---|
return | this | - |
css.reset()
.destroy()
Destroy and remove the current instance from globalThis.masterCSSs
.
Argument | Type | Default |
---|---|---|
return | this | - |
css.destroy()
MasterCSS.config
The default Master CSS configuration.
Default | { … } |
---|---|
Type |
MasterCSS.config
Global
globalThis.masterCSSs
All objects instantiated via new MasterCSS()
.
Default | [] |
---|---|
Type | MasterCSS[] |
globalThis.MasterCSS
Default | MasterCSS |
---|---|
Type | typeof RuntimeCSS |