-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Problem
Slim template engine's shorthand class syntax (.class-name) does not work with Tailwind's arbitrary values that use square brackets.
Example
/ ❌ Does NOT work - Slim parses [70%] as attribute, class becomes "max-w-"
.max-w-[70%]
.content
/ ✅ Works - explicit class attribute
div class="max-w-[70%]"
.content
/ ✅ Works - inline style
div style="max-width: 70%"
.contentRendered HTML (broken)
<!-- Expected -->
<div class="max-w-[70%]">...</div>
<!-- Actual -->
<div class="max-w-">...</div>Impact
max-widthnot applied, messages span full width- Found in
app/views/tenants/chats/_message.html.slim - Fixed in PR fix: Limit chat message bubble width to 70% #164
Investigation needed
- Is this a known Slim limitation?
- Can we configure Slim to handle
[differently? - Should we add a linter rule to catch this pattern?
Workarounds
- Use explicit
class=attribute:div class="max-w-[70%]" - Use inline style:
div style="max-width: 70%" - Define custom CSS class instead of arbitrary value
References
- PR fix: Limit chat message bubble width to 70% #164 - fix for chat message width
- CLAUDE.md updated with warning
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels