For my specific use case, this allows atomic/lite style to add things like prefixing at a lower level. As adding these as a wrapper around CXS creates either multiple class names/rules for a single rule or (in the case of arrays) a broken style.
Examples
Prefixed Keys
import cxs from 'cxs'
import prefixer from 'inline-style-prefixer/static'
const prefixed = prefixer({
alignItems: 'center'
})
const cx = cxs(prefixed)
In this example cx will equal webkit-box-align-center ms-flex-align-center align-items-center instead of just align-items-center.
Prefixed Values
import cxs from 'cxs'
import prefixer from 'inline-style-prefixer/static'
const prefixed = prefixer({
display: 'flex'
})
const cx = cxs(prefixed)
In this example the cxs.getCss() would include a broken rule:
My proposed solution is to add to the existing options object and allow adding a custom rule parser at a lower level so prefixes can be added without affecting class names.
The adapted tests in this PR hopefully illustrate how it can be used.
For my specific use case, this allows atomic/lite style to add things like prefixing at a lower level. As adding these as a wrapper around CXS creates either multiple class names/rules for a single rule or (in the case of arrays) a broken style.
Examples
Prefixed Keys
In this example
cx
will equalwebkit-box-align-center ms-flex-align-center align-items-center
instead of justalign-items-center
.Prefixed Values
In this example the
cxs.getCss()
would include a broken rule:Proposed Solution
My proposed solution is to add to the existing options object and allow adding a custom rule parser at a lower level so prefixes can be added without affecting class names.
The adapted tests in this PR hopefully illustrate how it can be used.
Example