gitbutler/packages/ui/tokens.config.js
Pavel Laptev ab0c70b673
Package UI updates (#4539)
* documentation update + design tokens generation

* ts config update

* formatting fix

* update tokens config format

* ignore JS files check

* Storybook version bump

* formatting fix

* dark theme toggle added
2024-07-30 16:45:19 +02:00

27 lines
498 B
JavaScript

import pluginCSS from '@cobalt-ui/plugin-css';
function pxToRem(token) {
if (token.$type === 'dimension' && token.$value.slice(-2) === 'px') {
return token.$value.slice(0, -2) / 16 + 'rem';
}
}
export default {
tokens: './design-tokens.json',
outDir: './src/styles/core',
plugins: [
pluginCSS({
filename: 'design-tokens.css',
modeSelectors: [
{
mode: 'dark',
selectors: [':root.dark']
}
],
p3: false,
colorFormat: 'hex',
transform: pxToRem
})
]
};