API Reference

@master/css-validator

Validator for Master CSS syntactic class.

Usage

import { isClassValid, validate, generateValidRules } from '@master/css-validator'

Guarantees validity by validating CSS rules generated by the Master CSS syntactic class, including checking media queries, selectors, and declarations.

This package is specific to the Node.js environment.


Functions

isClassValid()

Validates that the string is valid Master CSS syntactic class.

ArgumentTypeDefault
syntax
string
undefined
options?
{ css?: MasterCSS, config?: Config }
-
return
boolean
-
import { isClassValid } from '@master/css-validator'
isClassValid('text:center')
// => true
isClassValid('love:css')
// => false

generateValidRules()

Validate syntax validity and create Master CSS rules.

ArgumentTypeDefault
syntax
string
undefined
options?
{ css?: MasterCSS, config?: Config }
-
return
Rule[]
-
import { generateValidRules } from '@master/css-validator'
generateValidRules('text:center')
// => [{...}]
generateValidRules('love:css')
// => []

validate()

Validate and report errors for the given syntax.

ArgumentTypeDefault
syntax
string
undefined
options?
{ css?: MasterCSS, config?: Config }
-
return
{ isMasterCSS: boolean, erros: SyntaxError[]
-
import { validate } from '@master/css-validator'
validate('text:center')
// => { isMasterCSS: true, errors: []}
validate('love:css')
// => { isMasterCSS: false, errors: [SyntaxError]}
API Reference
theme-service

Standard CSS theme switching and service for Master CSS.

© Aoyue Design LLC.