Skip to main content
Yes, custom CSS for Website & App Surveys is supported. Use this when the Styling UI is not enough and you need tighter brand control.
Start with the built-in Styling Theme first. Use custom CSS only for advanced overrides.

Problem

Website & App Surveys are rendered inside your product, so your app’s global CSS can compete with survey styles. Common examples:
  • A global rule like button { ... !important; } changes survey buttons.
  • Typography resets change survey text spacing and sizing.
  • Utility-heavy global styles create unexpected visual differences between pages.

Solution

Scope your overrides to the survey root (#fbjs) and use !important for the exact targets you want to control. This gives you two important guarantees:
  1. Your custom rules apply only to the survey.
  2. Your rules reliably win against conflicting global styles.

Add Scoped Overrides In Global CSS

1

Open your global stylesheet

Use the stylesheet that is loaded on pages where surveys are shown (for example globals.css).
2

Add scoped rules under #fbjs

Keep all custom rules prefixed with #fbjs.
3

Use !important only where needed

Add !important to properties that are still being overridden by your app-wide CSS.
globals.css
Internal Tailwind utility classes are implementation details and may change over time. Prefer CSS variables and stable survey selectors scoped under #fbjs.

Best Practices

  • Keep all survey overrides in one section or file for easier maintenance.
  • Avoid global selectors without #fbjs (for example button, input, p) when styling surveys.
  • Document why each !important exists so future cleanup is easy.
  • After changes, hard refresh your page to clear cached SDK assets.

Troubleshooting

My app styles still win over survey styles
  • Increase selector specificity under #fbjs.
  • Add !important only on the conflicting property.
  • Check the browser inspector to confirm which rule is winning.
Survey styles are affecting the rest of my app
  • This usually means a selector is missing #fbjs.
  • Prefix every rule with #fbjs to keep styles isolated.

Survey UI CSS Class Reference

The following classes are used by packages/survey-ui and are safe to target when scoped with #fbjs.