From 4f307c76019b9e821ca925db84ef5341f23f1d72 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Sun, 26 Feb 2023 01:20:44 -0500 Subject: [PATCH] Use `syntax` as merged name instead of `mergedSyntax` This lets us retain the existing uses of syntax, and fixes colors that were being assigned incorrectly. --- styles/src/styleTree/editor.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/styles/src/styleTree/editor.ts b/styles/src/styleTree/editor.ts index c303057908..810b8da528 100644 --- a/styles/src/styleTree/editor.ts +++ b/styles/src/styleTree/editor.ts @@ -38,7 +38,7 @@ export default function editor(colorScheme: ColorScheme) { } } - const syntax: Syntax = { + const defaultSyntax: Syntax = { primary: { color: colorScheme.ramps.neutral(1).hex(), weight: fontWeights.normal, @@ -134,10 +134,10 @@ export default function editor(colorScheme: ColorScheme) { function createSyntax(colorScheme: ColorScheme): Syntax { if (!colorScheme.syntax) { - return syntax + return defaultSyntax } - return deepmerge>(syntax, colorScheme.syntax, { + return deepmerge>(defaultSyntax, colorScheme.syntax, { arrayMerge: (destinationArray, sourceArray) => [ ...destinationArray, ...sourceArray, @@ -145,7 +145,7 @@ export default function editor(colorScheme: ColorScheme) { }); } - const mergedSyntax = createSyntax(colorScheme) + const syntax = createSyntax(colorScheme) return { textColor: syntax.primary.color, @@ -303,6 +303,6 @@ export default function editor(colorScheme: ColorScheme) { color: borderColor(layer), }, }, - syntax: mergedSyntax, + syntax, } }