Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add inherit option for survery font customization #29199

Merged

Conversation

lucasheriques
Copy link
Contributor

Problem

Depends on PostHog/posthog-js#1763

Adds the option to inherit font family on Surveys.

It's the one that probably makes more sense for customers - uses the same font as their website.

Has one TODO before merging: adding the minimum version to use this feature. Will be done once the SDK PR is merged and I know the version.

Does this work well for both Cloud and self-hosted?

yes

How did you test this code?

verified locally if font family is being updated

@lucasheriques lucasheriques requested a review from a team February 25, 2025 17:27
@lucasheriques lucasheriques self-assigned this Feb 25, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added an 'inherit' font family option to surveys, allowing users to match their website's font for better integration.

  • Added inherit option to WEB_SAFE_FONTS in /frontend/src/scenes/surveys/constants.tsx, changing from string array to objects with value and label properties
  • Updated SurveyAppearance type in /frontend/src/types.ts to use the new structure with fontFamily: (typeof WEB_SAFE_FONTS)[number]['value']
  • Added .inherit CSS class in /frontend/src/styles/base.scss that sets font-family: inherit
  • Updated font family selection UI in /frontend/src/scenes/surveys/SurveyCustomization.tsx with a TODO to specify minimum posthog-js version required

4 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Feb 25, 2025

Size Change: -132 B (0%)

Total Size: 9.72 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 9.72 MB -132 B (0%)

compressed-size-action

@lucasheriques lucasheriques merged commit 203acba into master Feb 25, 2025
97 checks passed
@lucasheriques lucasheriques deleted the chore/add-inherit-option-for-surveys-font-customization branch February 25, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants