Dictionary and CSS Output
Boss CSS centralizes prop metadata in a dictionary and writes CSS through a minimal CSS builder.
Dictionary
api.dictionary.set('color', {
property: 'color',
aliases: ['color'],
description: 'CSS color property',
values: [],
initial: 'currentColor',
isCSSProp: true,
})
aliaseslet multiple prop names map to the same CSS property.isCSSPropmarks standard CSS properties.- The dictionary powers type generation and prop lookup.
CSS builder
api.css.selector({ className: api.contextToClassName('color', 'red', []) })
api.css.rule('color', 'red')
api.css.write()
The builder also supports:
pseudosfor pseudo selectorsqueryfor@mediawrappersrootvariables (used by tokens)
Output format
Boss CSS emits compact CSS:
.color\:red { color: red }
@media screen and (min-width: 376px) {
.at\:mobile\+\:display\:block { display: block }
}