mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-26 02:51:57 +03:00
48d2e8baea
* bump SB version * fix Segmented control import * formatting fix * fix formatting on build * migrate to Terrazzo + utility classes WIP * copy update * Update c-colors.mdx * fix hex color * move diff variables into tokens * Update c-colors.mdx * Update pnpm-lock.yaml * Update pnpm-lock.yaml * update terrazzo * Update pnpm-lock.yaml
41 lines
813 B
JavaScript
41 lines
813 B
JavaScript
import { defineConfig } from '@terrazzo/cli';
|
|
import css from '@terrazzo/plugin-css';
|
|
|
|
function pxToRem(token) {
|
|
if (token.$type === 'dimension' && token.$value.slice(-2) === 'px') {
|
|
return token.$value.slice(0, -2) / 16 + 'rem';
|
|
}
|
|
}
|
|
|
|
function clearFxPrefix(id) {
|
|
if (id.includes('fx.')) {
|
|
return id.replace('fx.', '').replace('.', '-');
|
|
}
|
|
}
|
|
|
|
export default defineConfig({
|
|
tokens: './src/lib/design-tokens.json',
|
|
outDir: './src/styles/core',
|
|
plugins: [
|
|
css({
|
|
filename: 'design-tokens.css',
|
|
modeSelectors: [
|
|
{
|
|
mode: 'dark',
|
|
selectors: [':root.dark']
|
|
}
|
|
],
|
|
p3: false,
|
|
transform: pxToRem,
|
|
generateName(variableId) {
|
|
return clearFxPrefix(variableId);
|
|
},
|
|
utility: {
|
|
bg: ['clr.bg.*'],
|
|
text: ['clr.text.*'],
|
|
border: ['clr.border.*']
|
|
}
|
|
})
|
|
]
|
|
});
|