套件
@master/css@master/css
The CSS language and framework for rapidly building modern and high-performance websites
Installation
npm i @master/cssAPI Reference
MasterCSS
The main body of this package is the class MasterCSS, which encapsulates the core business of Master CSS.
import { createCSS } from '@master/css'const css = createCSS(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 | Config |
|---|
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? | 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.
| Argument | Type | Default |
|---|---|---|
return | this | - |
css.destroy()globalThis.MasterCSS
| Type | typeof CSSRuntime |
|---|---|
| Default | MasterCSS |