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