generated from cloudoperators/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Open
Copy link
Labels
greenhouseGreenhouse core related taskGreenhouse core related task
Description
Task Description
Evaluate whether to adopt the cn utility function (combining clsx + tailwind-merge) for className management across the greenhouse app, as suggested in PR #1549 review comment.
The cn utility provides cleaner syntax for combining classNames, handles conditional classes gracefully, and resolves conflicting Tailwind CSS classes automatically.
Sub-tasks
- Audit current className patterns in greenhouse codebase
- Count template literal usage:
className={...} - Identify conditional className logic that could benefit from
cn - Find potential Tailwind class conflicts
- Count template literal usage:
- Check dependency status across monorepo
- Verify if
clsxandtailwind-mergeare already installed in other packages - Check if other apps (supernova, exampleapp) use similar utilities
- Verify if
- Assess value vs cost
- Estimate number of files that would benefit from refactoring
- Analyze bundle size impact of adding dependencies
- Evaluate code consistency improvements
- Make recommendation
- Document findings and recommendation (adopt project-wide, selective, or skip)
- If adopting: create implementation plan
- Implementation (if approved)
- Add
clsxandtailwind-mergedependencies - Create
src/lib/utils.tswithcnfunction - Set up TypeScript path alias
@/lib/utils(if needed) - Refactor existing code to use
cnutility - Update documentation/guidelines
- Add
Related Issues
- PR fix(greenhouse): remove whitespace below PluginNav in shell layout #1549 - Layout fix where the suggestion originated
Additional Context
Currently, the codebase uses template literals for className concatenation:
<div className={`greenhouse-shell ${shellStyles}`}>
The proposed approach would use:
<div className={cn("greenhouse-shell", shellStyles)}>
This is especially valuable for:
- Conditional classes: cn("base", isActive && "active")
- Tailwind conflicts: cn("px-4", "px-6") → results in "px-6"
Decision needed: Is this utility worth adopting project-wide, or is the current approach sufficient?Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
greenhouseGreenhouse core related taskGreenhouse core related task
Type
Projects
Status
New