Arbitrary value type inference for polymorphic utilities
- Dominant language
- Rust
- Stars
- 10
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Some Tailwind CSS v4 utility prefixes are polymorphic — the CSS property emitted depends on the value type inside brackets:
- `text-[#f00]` → `color: #f00` (colour)
- `text-[14px]` → `font-size: 14px` (length)
- `bg-[#f00]` → `background-color: #f00` (colour)
- `bg-[url(...)]` → `background-image: url(...)` (url)
The engine needs to:
1. Detect value type from raw bracket content (colour, length, percentage, url, etc.)
2. Dispatch to the correct CSS property based on inferred type
3. Support explicit type hints as override: `bg-[color:var(--my-bg)]`, `text-[length:var(--size)]`
Depends on #20.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading dependency issue #20 and then trace the engine's handling of bracketed utility values. Check how the examples map raw values to CSS properties, including explicit type hints, and consider the work done when colour, length, percentage, URL, and override cases dispatch correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, tailwindcss
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100