Skip to content

Commit 16fe37d

Browse files
ggazzoclaude
andcommitted
chore(fuselage): Remove Box SCSS and clear index.scss
Box.styles.scss deleted. Class definitions merged into primitives/box.scss. index.scss now empty — all component SCSS migrated to Tamagui. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ad19ee9 commit 16fe37d

5 files changed

Lines changed: 55 additions & 49 deletions

File tree

packages/fuselage/src/components/Box/Box.styles.scss

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/fuselage/src/components/Button/Button.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,17 @@ const Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(
493493
{...(props as any)}
494494
>
495495
<ButtonText>
496-
{icon && !loading && <Icon size='x16' name={icon} mie={4} />}
496+
{icon && !loading && (
497+
<Icon size='x16' name={icon} style={{ marginInlineEnd: 4 }} />
498+
)}
497499
{loading && (
498500
<Icon
499501
size='x16'
500502
name='loading'
501-
mie={children ? 4 : undefined}
502-
style={{ animation: 'rcx-spin-animation 0.8s linear infinite' }}
503+
style={{
504+
marginInlineEnd: children ? 4 : undefined,
505+
animation: 'rcx-spin-animation 0.8s linear infinite',
506+
}}
503507
/>
504508
)}
505509
{children}

packages/fuselage/src/components/Icon/Icon.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ const StyledIcon = styled(RcxText, {
1919
fontWeight: '400',
2020
fontStyle: 'normal',
2121
// fontVariant: 'normal' — not supported as Tamagui prop, handled by rcx-box reset
22-
lineHeight: 1,
22+
// lineHeight: 1 in CSS means 1×fontSize (unitless), but Tamagui treats 1 as 1px
23+
// Set dynamically via prop to match fontSize
2324
textRendering: 'auto',
2425
overflowWrap: 'normal',
2526
});
@@ -29,14 +30,26 @@ export type IconProps = Omit<BoxProps, 'name' | 'size'> & {
2930
size?: BoxProps['width'];
3031
};
3132

33+
// Convert 'x16' → 16, 'x20' → 20, or pass number directly
34+
const resolveSize = (size: any): number | undefined => {
35+
if (typeof size === 'number') return size;
36+
if (typeof size === 'string') {
37+
const match = /^x(\d+)$/.exec(size);
38+
if (match) return parseInt(match[1], 10);
39+
}
40+
return size;
41+
};
42+
3243
const Icon = forwardRef<HTMLElement, IconProps>(function Icon(
3344
{ name, size, ...props },
3445
ref,
3546
) {
47+
const resolvedSize = resolveSize(size);
3648
return (
3749
<StyledIcon
3850
aria-hidden='true'
39-
fontSize={size as any}
51+
fontSize={resolvedSize}
52+
lineHeight={resolvedSize}
4053
ref={ref}
4154
{...(props as any)}
4255
>
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
@import './Box/Box.styles.scss';
2-
@import './Sidebar/Sidebar.styles.scss';
3-
@import './SidebarV2/Sidebar.styles.scss';
4-
@import './ToastBar/ToastBar.styles.scss';
1+
// All component styles have been migrated to Tamagui styled components.
2+
// This file is intentionally empty.

packages/fuselage/src/styles/primitives/box.scss

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@use '../lengths.scss';
22
@use '../typography.scss';
3+
@import './traits/all.scss';
4+
@import '../mixins/all.scss';
35

46
%box {
57
flex: 0 1 auto;
@@ -38,12 +40,35 @@
3840

3941
.rcx-box {
4042
@extend %box;
41-
}
4243

43-
.rcx-box--full {
44-
@extend %box--full;
45-
}
44+
&--animated {
45+
@extend %box--animated;
46+
47+
&::before,
48+
&::after {
49+
@extend %box--animated;
50+
}
51+
}
52+
53+
&--full {
54+
@extend %box--full;
55+
56+
&::before,
57+
&::after {
58+
@extend %box;
59+
@extend %box--full;
60+
}
61+
}
62+
63+
&--with-inline-elements {
64+
@extend %--with-inline-elements !optional;
65+
}
4666

47-
.rcx-box--animated {
48-
@extend %box--animated;
67+
&--with-block-elements {
68+
@extend %--with-block-elements !optional;
69+
}
70+
71+
&--focusable {
72+
@include focus-state();
73+
}
4974
}

0 commit comments

Comments
 (0)