Package

Core

NPM package ( download / month )NPM package ( download / month )NPM package size (gzipped size)NPM package size (gzipped size)Source codeSource code

The core syntax parsing of Master CSS.

Installation

npm i @master/css

API Reference

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)
ArgumentTypeDefault
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.

ArgumentTypeDefault
...classNames
string[]
-
return
boolean
-
css.add('text:center', ...)

css.delete()

Remove an existing syntax class.

ArgumentTypeDefault
...classNames
string[]
-
return
boolean
-
css.delete('text:center', ...)

css.refresh()

Refresh the Master CSS with the configuration.

ArgumentTypeDefault
config?
Config
this.customConfig
return
this
-
css.refresh(config)

css.reset()

Clear all rules and reset to initial.

ArgumentTypeDefault
return
this
-
css.reset()

css.destroy()

Destroy and remove the current instance.

ArgumentTypeDefault
return
this
-
css.destroy()

globalThis.MasterCSS

Type
typeof CSSRuntime
Default
MasterCSS
Package
CLI

Command line interface for Master CSS.

Package
DevTools Hook

A global bridge injected into the browser runtime.

© Aoyue Design LLC.