Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,50 @@ const twMerge = extendTailwindMerge({
theme: {
radius: ["images", "rectangles", "buttonsM", "buttonsL"], // custom rounded classes from figma
},
classGroups: {
// custom typography classes from figma
"font-size": [
{
typo: [
"display-extralarge",
"display-large",
"display-medium",
"display-small",
"headline-large",
"headline-medium",
"headline-small",
"body-large",
"body-medium",
"body-small",
"label-extralarge",
"label-large",
"label-medium",
"label-small",
"title-large",
"title-medium",
"title-small",
],
},
],
// custom background colors from figma
"bg-color": [
{
bg: [
"background",
"background-blur",
"red",
"green",
"blue-primary",
"blue-primary-blur",
"blue-secondary",
"blue-tertiary",
"blue-tertiary-blur",
],
},
],
// custom text colors from figma
"text-color": [{ text: ["text-primary", "text-secondary", "text-accent-darkbg", "text-accent-lightbg"] }],
},
Comment on lines +35 to +52
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Custom color merge coverage is still incomplete (Line 35, Line 51).

bg-button-primary / bg-button-tertiary (from src/components/ui/button.tsx) and text-card-foreground (from src/components/card-icon/index.tsx) are not included, so conflicting custom color classes can still survive twMerge. This likely leaves issue #28 partially unresolved.

Suggested patch
       "bg-color": [
         {
           bg: [
             "background",
             "background-blur",
+            "button-primary",
+            "button-tertiary",
             "red",
             "green",
+            "grey",
             "blue-primary",
             "blue-primary-blur",
             "blue-secondary",
             "blue-tertiary",
             "blue-tertiary-blur",
           ],
         },
       ],
       // custom text colors from figma
-      "text-color": [{ text: ["text-primary", "text-secondary", "text-accent-darkbg", "text-accent-lightbg"] }],
+      "text-color": [
+        {
+          text: [
+            "text-primary",
+            "text-secondary",
+            "text-accent-darkbg",
+            "text-accent-lightbg",
+            "card-foreground",
+          ],
+        },
+      ],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"bg-color": [
{
bg: [
"background",
"background-blur",
"red",
"green",
"blue-primary",
"blue-primary-blur",
"blue-secondary",
"blue-tertiary",
"blue-tertiary-blur",
],
},
],
// custom text colors from figma
"text-color": [{ text: ["text-primary", "text-secondary", "text-accent-darkbg", "text-accent-lightbg"] }],
},
"bg-color": [
{
bg: [
"background",
"background-blur",
"button-primary",
"button-tertiary",
"red",
"green",
"grey",
"blue-primary",
"blue-primary-blur",
"blue-secondary",
"blue-tertiary",
"blue-tertiary-blur",
],
},
],
// custom text colors from figma
"text-color": [
{
text: [
"text-primary",
"text-secondary",
"text-accent-darkbg",
"text-accent-lightbg",
"card-foreground",
],
},
],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/utils.ts` around lines 35 - 52, The custom color merge map in
utils.ts is missing entries for the button and card color classes, so add
"bg-button-primary" and "bg-button-tertiary" into the "bg-color" group's bg
array and add "text-card-foreground" into the "text-color" group's text array so
twMerge will treat those custom classes as conflicting equivalents; update the
bg-color and text-color definitions (the arrays shown in the diff) to include
those string literals alongside the existing custom names.

},
})

Expand Down
Loading