Is merchant-authored Custom CSS that can reach outside the app embed allowed for App Store / BFS apps?

Hi everyone,

I’m working on a public app feature and want to check how others (and Shopify staff) handle this before building it.

Setup

  • The app adds a storefront widget through a theme app extension (app embed + optional app block).
  • In the app admin, merchants can enter their own Custom CSS to style the widget.
  • The app embed injects that CSS as a <style> element, set as text (so no script can run from it).

The question
Because it’s a normal <style> element, the merchant’s CSS isn’t limited to our widget. It can also restyle or hide theme elements, e.g. the product title or the add-to-cart button.

  1. Is it acceptable for an App Store / Built for Shopify app to inject merchant-authored CSS that can affect theme elements outside the app’s own block/embed? Or should app-injected CSS be limited to the app’s own elements?
  2. Has anyone had App Review flag this? If so, what did they ask you to change?
  3. Would you scope it, e.g. with CSS @scope (.widget-root) or by prefixing every selector with a root class? How do you handle merchants who already style outside the widget?

What we already plan to do
We’ll follow the same rules as Shopify’s own theme editor Custom CSS:

  • block @import, @charset and @namespace
  • only allow URLs from https://cdn.shopify.com (plus inline data:image/)

so the CSS can’t load anything from outside servers.

Partner Support told me this isn’t covered in the published App Store requirements, so they couldn’t confirm either way. The only related rule I found is 5.1.1 (modify themes only through theme app extensions), which this approach follows.

Also curious whether the upcoming “tightening the boundaries for storefront app code” from the Securing your app, together post is expected to cover app-injected CSS.

Thanks!

Hi @Arsh_Mansuri, I see you’ve already checked with Partner Support. I’ve asked for clarification on whether the App Store requirements allow merchant-authored CSS to affect elements outside the app’s widget.

If you choose the @scope approach you mentioned, it limits selector matching, but names defined by @keyframes, @font-face, and @layer remain global, even inside the scope. Those can still conflict with names used by the theme. The CSS specification explains this distinction.

I don’t yet have confirmed guidance on BFS eligibility or how the announced storefront changes would apply either. I’ll share any updates here.

I’ve confirmed that BFS doesn’t require merchant-authored CSS to stay inside the app’s widget. Allowing it to affect other theme elements doesn’t automatically disqualify the app, though we’d need to review the implementation to confirm eligibility.

The editor needs to make clear that CSS can affect other parts of the theme, so merchants understand what they’re changing. I’d also recommend a preview so they can see those effects before saving.

You’re already using theme app extensions. The other relevant BFS requirements to keep in mind are:

  • Avoiding Asset API theme edits.
  • Keeping any reduction in the storefront Lighthouse performance score to 10 points or less.
  • Using the contextual save bar for the CSS editor’s save action.