[React Doctor] Collapsed w-N h-N to size-N across 8 files#430
Open
github-actions[bot] wants to merge 1 commit into
Open
[React Doctor] Collapsed w-N h-N to size-N across 8 files#430github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Collapsed
w-N h-Ntosize-Nacross 8 files — Tailwind v3.4 single-axis shorthand for square sizing, identical CSS outputThe
size-Nutility ships bothwidthandheightfrom one token, sow-3 h-3→size-3andh-[18px] w-[18px]→size-[18px]produce byte-identical CSS. The rule only fires when both axes match (w-1/2won't collapse; responsive prefixes suppress it).Changes
apps/e2e-app/src/App.tsx:309—design-no-redundant-size-axes:w-12 h-12→size-12(gradient div)apps/e2e-app/src/App.tsx:336—design-no-redundant-size-axes:w-8 h-8→size-8(animated-pulse)apps/e2e-app/src/App.tsx:339—design-no-redundant-size-axes:w-8 h-8→size-8(animated-spin)apps/e2e-app/src/App.tsx:340—design-no-redundant-size-axes:w-8 h-8→size-8(animated-bounce)apps/e2e-app/src/App.tsx:351—design-no-redundant-size-axes:w-0 h-0→size-0(zero-size-element)apps/website/components/mobile-demo-animation.tsx:753—design-no-redundant-size-axes:h-5 w-5→size-5(activity-row dot)apps/website/components/mobile-demo-animation.tsx:840—design-no-redundant-size-axes:h-0 w-0→size-0(chart-label arrow)apps/website/components/github-button.tsx:17—design-no-redundant-size-axes:h-[18px] w-[18px]→size-[18px](GitHub icon)apps/website/components/homepage-demo.tsx:256—design-no-redundant-size-axes:h-3 w-3→size-3(tooltip arrow)apps/website/components/ui/collapsible.tsx:49—design-no-redundant-size-axes:w-3 h-3→size-3(ChevronDown)apps/website/components/ui/collapsible.tsx:51—design-no-redundant-size-axes:w-3 h-3→size-3(ChevronRight)apps/website/components/view-docs-button.tsx:16—design-no-redundant-size-axes:h-[15px] w-[15px]→size-[15px](BookOpen icon)apps/website-v2/components/ui/navigation-menu.tsx:145—design-no-redundant-size-axes:h-2 w-2→size-2(indicator arrow)apps/website-v2/components/ui/chart.tsx:293—design-no-redundant-size-axes:h-2 w-2→size-2(legend swatch)Note
Low Risk
Cosmetic class renames only; no logic, APIs, or asymmetric sizing changes.
Overview
This PR replaces paired equal
width/heightTailwind classes withsize-*across eight files in the e2e app, marketing site, andwebsite-v2UI kit. Examples includew-12 h-12→size-12,h-3 w-3→size-3, and arbitrary squares likeh-[18px] w-[18px]→size-[18px].Touches are limited to className strings on demo fixtures (gradient/animated/zero-size boxes), icons (
GithubButton,ViewDocsButton), collapsible chevrons, chart legend swatches, navigation menu indicator diamonds, homepage tooltip carets, and mobile demo placeholders/arrows. Rendered layout should be unchanged; only class lists are shorter.Reviewed by Cursor Bugbot for commit a1bd406. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Collapsed paired Tailwind width/height utilities into
size-*across 8 files to remove redundancy with no visual changes. This usestailwindcssv3.4 shorthand for square elements.w-N h-Nandh-[Npx] w-[Npx]withsize-N/size-[Npx]in icons, indicators, and animated elements.Written for commit a1bd406. Summary will update on new commits.