@cryptic-css/core

The core of CCSS and APIs for extending it with new features. Includes support for all CSS properties.

Exports#

ccss (default export)#

Awaits a style object and returns a CSS string. Not registered keys will be ignored by default.

import ccss from 'ccss'
Live Editor
Result

createCCSS(defaultOptions?)#

Create a custom CCSS function with your own configuration. Calling this in most cases is completely unnecessary, it's only needed if you want to use multiple CCSS instances at once.

import { createCCSS } from '@cryptic-css/core'
const ccss = createCCSS()

Options#

applyUnit#

A function that's being called with number values to apply a certain unit.

It receives the value as an argument, and it should return the desired output.

ccss.setOptions({
applyUnit: x => `${x}cm`
})

All other transformed options are available.

Last updated on by Pablo Henrique