Skip to content

Commit 573d927

Browse files
committed
Refactor class names to use 'size-*' utility
Replaces explicit width and height utility classes (e.g., w-4 h-4) with the 'size-*' utility for consistency and brevity. Also removes unnecessary flex-shrink-0 in favor of shrink-0 and simplifies overflow handling in code blocks.
1 parent 424684e commit 573d927

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

apps/portal/src/app/reference/ModernApiReference.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,15 @@ function JsonViewer({ data, title, defaultOpen = false }: JsonViewerProps) {
305305
Schema
306306
</Badge>
307307
{isOpen ? (
308-
<ChevronDownIcon className="h-4 w-4 text-muted-foreground" />
308+
<ChevronDownIcon className="size-4 text-muted-foreground" />
309309
) : (
310-
<ChevronRightIcon className="h-4 w-4 text-muted-foreground" />
310+
<ChevronRightIcon className="size-4 text-muted-foreground" />
311311
)}
312312
</div>
313313
</button>
314314
{isOpen && (
315315
<div className="p-4 bg-muted/20">
316-
<pre className="text-xs bg-background border border-border p-4 rounded-lg overflow-x-auto max-h-80 overflow-y-auto font-mono">
316+
<pre className="text-xs bg-background border border-border p-4 rounded-lg overflow-auto max-h-80 font-mono">
317317
<code className="text-foreground">
318318
{JSON.stringify(data, null, 2)}
319319
</code>
@@ -374,18 +374,18 @@ function CodeExample({
374374
onClick={copyToClipboard}
375375
className="h-6 px-2 text-xs"
376376
>
377-
<CopyIcon className="h-3 w-3 mr-1" />
377+
<CopyIcon className="size-3 mr-1" />
378378
{copied ? "Copied!" : "Copy"}
379379
</Button>
380380
</div>
381381
{highlightedCode ? (
382382
<div
383-
className="text-xs bg-background p-4 overflow-x-auto max-h-80 overflow-y-auto border-l border-r border-b border-border rounded-b-lg [&_pre]:m-0 [&_pre]:bg-transparent [&_code]:bg-transparent"
383+
className="text-xs bg-background p-4 overflow-auto max-h-80 border-x border-b border-border rounded-b-lg [&_pre]:m-0 [&_pre]:bg-transparent [&_code]:bg-transparent"
384384
// biome-ignore lint/security/noDangerouslySetInnerHtml: Shiki generates safe HTML for syntax highlighting
385385
dangerouslySetInnerHTML={{ __html: highlightedCode }}
386386
/>
387387
) : (
388-
<pre className="text-xs bg-background p-4 overflow-x-auto max-h-80 overflow-y-auto font-mono border-l border-r border-b border-border rounded-b-lg">
388+
<pre className="text-xs bg-background p-4 overflow-auto max-h-80 font-mono border-x border-b border-border rounded-b-lg">
389389
<code className="text-foreground">{code}</code>
390390
</pre>
391391
)}
@@ -556,7 +556,7 @@ function ModernApiReferenceContent() {
556556
: "text-muted-foreground hover:text-foreground hover:bg-violet-800/15 border-transparent hover:border-violet-800/50"
557557
}`}
558558
>
559-
<HomeIcon className="h-4 w-4 mr-2" />
559+
<HomeIcon className="size-4 mr-2" />
560560
Introduction
561561
</button>
562562
</div>
@@ -572,9 +572,9 @@ function ModernApiReferenceContent() {
572572
className="flex items-center w-full px-3 py-1.5 text-sm hover:bg-violet-800/20 rounded-lg hover:border-violet-800/50 border border-transparent transition-colors duration-300 mb-1"
573573
>
574574
{expandedGroups[tag] ? (
575-
<ChevronDownIcon className="h-4 w-4 mr-2 text-muted-foreground" />
575+
<ChevronDownIcon className="size-4 mr-2 text-muted-foreground" />
576576
) : (
577-
<ChevronRightIcon className="h-4 w-4 mr-2 text-muted-foreground" />
577+
<ChevronRightIcon className="size-4 mr-2 text-muted-foreground" />
578578
)}
579579
<span className="text-foreground text-sm font-medium">
580580
{tag}
@@ -616,7 +616,7 @@ function ModernApiReferenceContent() {
616616
>
617617
<Badge
618618
variant="outline"
619-
className={`mr-2 text-xs font-mono uppercase flex-shrink-0 ${getMethodColor(
619+
className={`mr-2 text-xs font-mono uppercase shrink-0 ${getMethodColor(
620620
method,
621621
)}`}
622622
>
@@ -662,9 +662,9 @@ function ModernApiReferenceContent() {
662662
{/* Key Features */}
663663
<div className="grid grid-cols-1 md:grid-cols-3 gap-6 mt-12">
664664
<div className="text-center space-y-3 p-6 rounded-lg border border-border bg-card/30">
665-
<div className="w-12 h-12 rounded-lg bg-blue-500/10 flex items-center justify-center mx-auto">
665+
<div className="size-12 rounded-lg bg-blue-500/10 flex items-center justify-center mx-auto">
666666
<svg
667-
className="w-6 h-6 text-blue-600"
667+
className="size-6 text-blue-600"
668668
fill="none"
669669
stroke="currentColor"
670670
viewBox="0 0 24 24"
@@ -687,9 +687,9 @@ function ModernApiReferenceContent() {
687687
</div>
688688

689689
<div className="text-center space-y-3 p-6 rounded-lg border border-border bg-card/30">
690-
<div className="w-12 h-12 rounded-lg bg-green-500/10 flex items-center justify-center mx-auto">
690+
<div className="size-12 rounded-lg bg-green-500/10 flex items-center justify-center mx-auto">
691691
<svg
692-
className="w-6 h-6 text-green-600"
692+
className="size-6 text-green-600"
693693
fill="none"
694694
stroke="currentColor"
695695
viewBox="0 0 24 24"
@@ -712,9 +712,9 @@ function ModernApiReferenceContent() {
712712
</div>
713713

714714
<div className="text-center space-y-3 p-6 rounded-lg border border-border bg-card/30">
715-
<div className="w-12 h-12 rounded-lg bg-purple-500/10 flex items-center justify-center mx-auto">
715+
<div className="size-12 rounded-lg bg-purple-500/10 flex items-center justify-center mx-auto">
716716
<svg
717-
className="w-6 h-6 text-purple-600"
717+
className="size-6 text-purple-600"
718718
fill="none"
719719
stroke="currentColor"
720720
viewBox="0 0 24 24"
@@ -751,7 +751,7 @@ function ModernApiReferenceContent() {
751751
</p>
752752
<ol className="space-y-4 text-sm">
753753
<li className="flex items-start gap-3">
754-
<div className="w-6 h-6 rounded-full bg-blue-500 text-white flex items-center justify-center text-xs font-bold flex-shrink-0 mt-0.5">
754+
<div className="size-6 rounded-full bg-blue-500 text-white flex items-center justify-center text-xs font-bold shrink-0 mt-0.5">
755755
1
756756
</div>
757757
<div>
@@ -760,7 +760,7 @@ function ModernApiReferenceContent() {
760760
</div>
761761
</li>
762762
<li className="flex items-start gap-3">
763-
<div className="w-6 h-6 rounded-full bg-blue-500 text-white flex items-center justify-center text-xs font-bold flex-shrink-0 mt-0.5">
763+
<div className="size-6 rounded-full bg-blue-500 text-white flex items-center justify-center text-xs font-bold shrink-0 mt-0.5">
764764
2
765765
</div>
766766
<div>
@@ -769,7 +769,7 @@ function ModernApiReferenceContent() {
769769
</div>
770770
</li>
771771
<li className="flex items-start gap-3">
772-
<div className="w-6 h-6 rounded-full bg-blue-500 text-white flex items-center justify-center text-xs font-bold flex-shrink-0 mt-0.5">
772+
<div className="size-6 rounded-full bg-blue-500 text-white flex items-center justify-center text-xs font-bold shrink-0 mt-0.5">
773773
3
774774
</div>
775775
<div>
@@ -888,7 +888,7 @@ function ModernApiReferenceContent() {
888888
);
889889
}}
890890
>
891-
<ExternalLinkIcon className="h-4 w-4 mr-2" />
891+
<ExternalLinkIcon className="size-4 mr-2" />
892892
View in API Reference
893893
</Button>
894894
</div>
@@ -903,14 +903,14 @@ function ModernApiReferenceContent() {
903903
value="request"
904904
className="flex items-center gap-2 data-[state=active]:bg-background data-[state=active]:border border-border rounded-md py-2 text-sm"
905905
>
906-
<span className="h-2 w-2 rounded-full bg-blue-500"></span>
906+
<span className="size-2 rounded-full bg-blue-500"></span>
907907
Request
908908
</TabsTrigger>
909909
<TabsTrigger
910910
value="response"
911911
className="flex items-center gap-2 data-[state=active]:bg-background data-[state=active]:border border-border rounded-md py-2 text-sm"
912912
>
913-
<span className="h-2 w-2 rounded-full bg-green-500"></span>
913+
<span className="size-2 rounded-full bg-green-500"></span>
914914
Response
915915
</TabsTrigger>
916916
</TabsList>

0 commit comments

Comments
 (0)