Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4282,8 +4282,7 @@ const staticStyles = (theme: ThemeColors) =>
},

cardSectionTitle: {
fontSize: variables.fontSizeLarge,
Comment on lines 4284 to -4285

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MelvinBot is there a reason to do it this way rather than <Text variant="textStrong" ...

please dont change, answer in thread

@MelvinBot MelvinBot Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Two reasons, and they're not equally strong.

cardSectionTitlevariant wouldn't work without a much larger change.

In src/components/Text.tsx:65-66 the variant is spread before style, so anything in style wins. Every card header renders as style={[styles.textHeadline, styles.cardSectionTitle, ...]}, and textHeadline is textVariants.h1 + color: theme.heading. So <Text variant="textStrong" style={[styles.textHeadline, ...]}> would render at h1 size — the variant would be dead. Making it work means dropping textHeadline and re-supplying color: theme.heading at each call site.

And most of those call sites aren't <Text> at all — they pass the style down as a titleStyle/titleStyles prop, so there's no variant prop to set without threading a new one through each component:

The 9 call sites

Passed as a prop (no <Text> to put variant on):

Direct <Text>, but stacked behind textHeadline:

getWidgetContainerTitleStyle — you're right, variant would be cleaner here.

Only two consumers, both plain <Text style={styles.getWidgetContainerTitleStyle(theme.text)}> with nothing else stacked on: WidgetContainer.tsx:36 and InsightTitleDropdown.tsx:82. Those could become <Text variant="textStrong" color={theme.text}> and the helper could go away entirely. I kept them consistent with the cardSectionTitle change instead, but that's a preference, not a constraint.

Worth noting: nothing in src/ uses the variant prop yet, so either way this would be the first usage.

Not changing anything, per your note.


view run · view recording

lineHeight: variables.lineHeightXLarge,
...textVariants.textStrong,
},

emptyCardSectionTitle: {
Expand Down Expand Up @@ -7253,9 +7252,7 @@ const plainStyles = (theme: ThemeColors) =>

getWidgetContainerTitleStyle: (color: string) =>
({
...FontUtils.fontFamily.platform.EXP_NEUE_BOLD,
fontSize: 17,
lineHeight: variables.widgetHeaderTitleLineHeight,
...textVariants.textStrong,
color,
}) satisfies TextStyle,

Expand Down
Loading