fix: move @property declaration to top-level for gradient-border comp…#84
Conversation
WalkthroughThe change removes a conditional Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/ui-layout/app/globals.css (1)
569-573: Move@propertydeclaration near the top of the file.While moving
@property --border-angleto top-level scope (outside@layer/@supports) correctly fixes the registration issue, placing it at the end of the file is unconventional. Since the property is used in the@keyframes borderanimation at line 115, it's better practice to declare the@propertynear the beginning of the file, after imports but before rules that use it. This ensures the custom property is registered early in the parsing phase.Consider relocating this declaration to just after the
@custom-variantline (after line 10) or at the start of the@layer utilitiesblock:@custom-variant dark (&:is(.dark *)); +@property --border-angle { + inherits: false; + initial-value: 0deg; + syntax: '<angle>'; +} + @theme {Then remove the declaration from lines 569-573.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/ui-layout/app/globals.css(1 hunks)
🔇 Additional comments (1)
apps/ui-layout/app/globals.css (1)
569-573: Approve the core fix:@propertynow registered at top-level.The change correctly moves the
@property --border-angledeclaration out of nested at-rules (@layer,@supports) to top-level scope. This resolves the browser registration issue—browsers ignore@propertyrules declared inside conditional blocks, and moving it to top-level ensures consistent animation across all supporting browsers. The fix aligns with the PR objective.Please verify that the gradient-border component animates smoothly after this change. You mentioned a screenshot was included in the PR—ensure the animation displays correctly in all target browsers.
Description
This PR fixes the gradient-border animation bug caused by invalid placement of the
@propertyrule.Previously, the declaration was nested inside
@layerand@supports, which prevented the browser from properly registering the--border-anglecustom property.Changes
@propertydeclaration to top-level for proper registration.--border-angleis globally available before keyframes and gradient logic.gradient-bordercomponent now animates smoothly without missing variable errors.Motivation
Browsers ignore
@propertyrules declared inside nested blocks like@layeror@supports.By moving it to the top-level scope, we ensure consistent animation and fix the missing
--border-angleissue across all browsers.Screenshots
2025-10-25.1.01.45.mov
Summary by CodeRabbit
Release Notes