Skip to content

Commit d7a4b98

Browse files
authored
fix: update brand loading variants for consistent sizing (#1223)
I was seeing strange behavior on /Tools/Registration when forcing the check that happens on page load to fire again. The brand logo SVG was rendering very large. So I set the size to small. But the SVG was still rendering strangely due to the square width and height classes. In the SVG source code, I took `viewBox="0 0 133.52 76.97"` and converted that to an aspect ratio, `133.52/76.97`. And for simpler integers - `133.52/76.97 ≈ 1.735` which is close to `7/4 (1.75)`. So we can use - `aspect-[7/4]`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Style** - Enhanced the brand loading component’s appearance by enforcing a consistent aspect ratio and streamlining its dimension settings to focus solely on width parameters. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 1f00212 commit d7a4b98

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

unraid-ui/src/components/brand/brand-loading.variants.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { cva } from 'class-variance-authority';
22

3-
export const brandLoadingVariants = cva('inline-flex items-center justify-center w-full h-full', {
3+
export const brandLoadingVariants = cva('inline-flex items-center justify-center w-full h-full aspect-[7/4]', {
44
variants: {
55
variant: {
66
default: '',
77
black: 'text-black fill-black',
88
white: 'text-white fill-white',
99
},
1010
size: {
11-
sm: 'h-12 w-12',
12-
md: 'h-16 w-16',
13-
lg: 'h-20 w-20',
14-
full: 'h-full w-full',
11+
sm: 'w-12',
12+
md: 'w-16',
13+
lg: 'w-20',
14+
full: 'w-full',
1515
},
1616
},
1717
defaultVariants: {

0 commit comments

Comments
 (0)