Fix pagination: compact size and reliable theme responsiveness - #897
Conversation
Previous vendor view used Tailwind utility classes (bg-rg-card etc.) built from PHP variables — Tailwind's scanner cannot detect classes stored in runtime variables, so they were absent from the CSS bundle, making the pagination ignore the active theme. New approach: define rg-page-btn / rg-page-btn-active / rg-page-btn-off as @layer components rules in app.css using raw CSS variables (--rg-card, --rg-text-2, --rg-accent-soft, etc.). These are always emitted regardless of content scanning, and inherit the correct values from the html[data-theme] overrides at runtime. Also reduced button size from h-8 (32px) to h-[26px] and icons from size-3.5 to size-3 for a more compact pagination bar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 7 minutes and 47 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Root cause of broken theme colors: the previous vendor view stored Tailwind class names in PHP variables (
$btnIdle,$btnActive, etc.). Tailwind's content scanner cannot follow PHP variable interpolation at build time, so classes likebg-rg-card,text-rg-text2, etc. were never emitted into the CSS bundle. The pagination fell back to browser defaults regardless of the active theme.Fix: moved all pagination styles into
@layer componentsinapp.cssas three explicit CSS classes (rg-page-btn,rg-page-btn-active,rg-page-btn-off) using raw CSS variable references (var(--rg-card),var(--rg-accent-soft), etc.). These are always emitted unconditionally and inherit the correct resolved values from thehtml[data-theme="light"]overrides at runtime.Compact size: reduced button height from
h-8(32px) to 26px and chevron icons fromsize-3.5tosize-3.Test plan
🤖 Generated with Claude Code
Summary by cubic
Fixes pagination theme colors and makes the control more compact. Styles now follow light/dark themes reliably and disabled/active states render correctly.
Bug Fixes
@layer componentsinapp.cssasrg-page-btn,rg-page-btn-active, andrg-page-btn-offusing CSS variables, and updated the vendor view to use them.Refactors
Written for commit f33140c. Summary will update on new commits.