fix(tailwind): hsl and hsla colors for ms outlook#2948
fix(tailwind): hsl and hsla colors for ms outlook#2948tlow92 wants to merge 1 commit intoresend:canaryfrom
Conversation
|
@tlow92 is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
|
commit: |
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 4/5
- Potential compatibility issue: new HSL/HSLA parsing in
packages/tailwind/src/utils/css/sanitize-declarations.tsmay throw on valid CSS hues using rad/grad/turn ornone, which could reject legitimate styles - Confidence is low for the finding, so overall risk feels minimal and the PR is likely safe to merge
- Pay close attention to
packages/tailwind/src/utils/css/sanitize-declarations.ts- HSL/HSLA hue parsing may be too strict
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/tailwind/src/utils/css/sanitize-declarations.ts">
<violation number="1" location="packages/tailwind/src/utils/css/sanitize-declarations.ts:297">
P2: The new hsl/hsla parsing only accepts hue in degrees; valid angle units (rad/grad/turn) or the `none` keyword leave `h` undefined and cause a throw on valid CSS syntax.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| continue; | ||
| } | ||
| } | ||
| if (child.type === 'Dimension' && child.unit === 'deg') { |
There was a problem hiding this comment.
P2: The new hsl/hsla parsing only accepts hue in degrees; valid angle units (rad/grad/turn) or the none keyword leave h undefined and cause a throw on valid CSS syntax.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/tailwind/src/utils/css/sanitize-declarations.ts, line 297:
<comment>The new hsl/hsla parsing only accepts hue in degrees; valid angle units (rad/grad/turn) or the `none` keyword leave `h` undefined and cause a throw on valid CSS syntax.</comment>
<file context>
@@ -246,6 +278,57 @@ export function sanitizeDeclarations(nodeContainingDeclarations: CssNode) {
+ continue;
+ }
+ }
+ if (child.type === 'Dimension' && child.unit === 'deg') {
+ if (h === undefined) {
+ h = Number.parseFloat(child.value);
</file context>
Fixes #2947 partially.
When using tailwind it converts hsl and hsla similar to existing rgb sanitization
If you can suggest me how you wish this to be handled for non-tailwind react-email, I can fix it there as well.
Summary by cubic
Converts hsl() and hsla() colors to rgb during Tailwind CSS sanitization to ensure correct rendering in Microsoft Outlook. Adds tests covering multiple syntaxes and alpha formats.
Written for commit 7d5fb1f. Summary will update on new commits.