diff --git a/script/lib/variable-collection.ts b/script/lib/variable-collection.ts index ba1c4cfdb..062714880 100644 --- a/script/lib/variable-collection.ts +++ b/script/lib/variable-collection.ts @@ -50,7 +50,9 @@ export default class VariableCollection { const fullName = getFullName(this.prefix, path) if (value === 'transparent') { - value = 'rgba(0,0,0,0)' + // TODO: revert before merge + // value = 'rgba(0,0,0,0)' + value = '#ffffff00' } const variable: ModeVariable = {name: fullName, path, value} diff --git a/src/utils.ts b/src/utils.ts index a90fedf45..e5747fe09 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -18,7 +18,9 @@ export function get(path: string) { } export function alpha(value: Value, amount: number) { - return (obj: any) => color2k.transparentize(resolveValue(value, obj), 1 - amount).replace(/ /g, '') + // TODO: revert before merge + // return (obj: any) => color2k.transparentize(resolveValue(value, obj), 1 - amount).replace(/ /g, '') + return (obj: any) => color2k.toHex(color2k.transparentize(resolveValue(value, obj), 1 - amount).replace(/ /g, '')) } export function lighten(value: Value, amount: number) { @@ -26,7 +28,9 @@ export function lighten(value: Value, amount: number) { } export function darken(value: Value, amount: number) { - return (obj: any) => color2k.darken(resolveValue(value, obj), amount).replace(/ /g, '') + // TODO: revert before merge + // return (obj: any) => color2k.darken(resolveValue(value, obj), amount).replace(/ /g, '') + return (obj: any) => color2k.toHex(color2k.darken(resolveValue(value, obj), amount).replace(/ /g, '')) } export function mix(color1: Value, color2: Value, weight: number = 0.5) { diff --git a/tempColorTokenBuild.ts b/tempColorTokenBuild.ts index 0fda723f5..dbe485762 100644 --- a/tempColorTokenBuild.ts +++ b/tempColorTokenBuild.ts @@ -32,11 +32,24 @@ const buildPath = 'tokens-v2-private' const inputPath = 'tokens' const prefix = 'primer' +const functionalColorFiles = { + light: [ + `tokens/functional/color/primitives-light.json`, + `tokens/functional/color/marketing-light.json`, + `tokens/functional/color/misc-light.json`, + `tokens/functional/color/syntax-light.json`, + `tokens/functional/color/diff-light.json`, + `tokens/functional/color/checks-light.json`, + `tokens/functional/color/components-light.json`, + `tokens/functional/color/ansi-light.json`, + ] +} + const themes = [ - ['light', [`tokens/functional/color/primitives-light.json`], [`tokens/base/color/light.json`]], - ['light-tritanopia', [`tokens/functional/color/primitives-light.json`], [`tokens/base/color/light.json`, `tokens/base/color/light-tritanopia.json`]], - ['light-colorblind', [`tokens/functional/color/primitives-light.json`], [`tokens/base/color/light.json`, `tokens/base/color/light-colorblind.json`]], - ['light-high-contrast', [`tokens/functional/color/primitives-light.json`, `tokens/functional/color/primitives-light-high-contrast.json`], [`tokens/base/color/light.json`, `tokens/base/color/light-high-contrast.json`]], + ['light', functionalColorFiles.light, [`tokens/base/color/light.json`]], + ['light-tritanopia', [...functionalColorFiles.light], [`tokens/base/color/light.json`, `tokens/base/color/light-tritanopia.json`]], + ['light-colorblind', [...functionalColorFiles.light], [`tokens/base/color/light.json`, `tokens/base/color/light-colorblind.json`]], + ['light-high-contrast', [...functionalColorFiles.light, `tokens/functional/color/primitives-light-high-contrast.json`], [`tokens/base/color/light.json`, `tokens/base/color/light-high-contrast.json`]], ['dark', [`tokens/functional/color/primitives-dark.json`], [`tokens/base/color/dark.json`]], ['dark-dimmed', [`tokens/functional/color/primitives-dark.json`], [`tokens/base/color/dark.json`, `tokens/base/color/dark-dimmed.json`]], ['dark-tritanopia', [`tokens/functional/color/primitives-dark.json`], [`tokens/base/color/dark.json`, `tokens/base/color/dark-tritanopia.json`]],