Skip to content

feat: add option to use font-based icon sizing#3882

Open
natew wants to merge 1 commit into
mainfrom
v2-icon-sizing
Open

feat: add option to use font-based icon sizing#3882
natew wants to merge 1 commit into
mainfrom
v2-icon-sizing

Conversation

@natew

@natew natew commented Feb 6, 2026

Copy link
Copy Markdown
Member

No description provided.

@railway-app

railway-app Bot commented Feb 6, 2026

Copy link
Copy Markdown

🚅 Deployed to the tamagui-pr-3882 environment in tamagui

Service Status Web Updated (UTC)
tamagui ✅ Success (View Logs) Web Feb 6, 2026 at 3:57 am

const size =
typeof props.size === 'string'
? getTokenValue(props.size as any, 'size')
: props.size || (styledContext.size === '$true' ? undefined : styledContext.size)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think wrong actually - we'd expect <Icon size="$4" to actually be font-size body $4 so useIconSize shouldnt return contextSize but actual final size

const iconSize =
(typeof size === 'number' ? size * 0.5 : getFontSize(size as FontSizeTokens)) *
scaleIcon
const iconSize = useIconSize({

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and then i guess here we'd basically want something better tbh - we have SizeContext already too, maybe we avoid passing any props or cloning at all? and just icons can read the SizeContext and decide themselves using their own themed wrapper.

For non-tamagui icons we do nothing, but we can document wrapping them easily with themed, we should really rename that helper, put it in a cleaner package name, etc, and document

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant