Skip to content

Commit b10cfab

Browse files
committed
Fix color variables (come before white/black)
1 parent c159ecc commit b10cfab

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

packages/backend/src/tailwind/conversionTables.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ export function getColorInfo(fill: SolidPaint | ColorStop) {
134134
let hex: string = "#" + rgbTo6hex(fill.color);
135135
let meta: string = "";
136136

137+
// variable
138+
if (
139+
localTailwindSettings.customTailwindColors &&
140+
fill.boundVariables?.color
141+
) {
142+
colorName = variableToColorName(fill.boundVariables.color);
143+
colorType = "variable";
144+
meta = "custom";
145+
}
146+
137147
// Check for pure black/white first
138148
if (fill.color.r === 0 && fill.color.g === 0 && fill.color.b === 0) {
139149
return {
@@ -153,16 +163,6 @@ export function getColorInfo(fill: SolidPaint | ColorStop) {
153163
};
154164
}
155165

156-
// variable
157-
if (
158-
localTailwindSettings.customTailwindColors &&
159-
fill.boundVariables?.color
160-
) {
161-
colorName = variableToColorName(fill.boundVariables.color);
162-
colorType = "variable";
163-
meta = "custom";
164-
}
165-
166166
// solid color
167167
else {
168168
// get tailwind color as comparison

0 commit comments

Comments
 (0)