Why is the CSS in the section stylesheet tag not rebuilding in my liquid files?

Topic summary

Problem with Shopify Liquid section CSS not recompiling when section files are uploaded programmatically to users’ themes. The CSS inside the {% stylesheet %} tag is not automatically rebuilt, which leaves templates visually broken because some styles are missing.

Current workaround:

  • Manually add a space to the Liquid file and save it again.
  • That action triggers the CSS rebuild and restores the missing styles.

Key constraints raised:

  • The goal is full automation for app installs, without requiring merchants to edit files manually.
  • Moving the CSS into a regular <style> tag is known as an alternative, but it is seen as less desirable because:
    • the styles are no longer self-contained within the section,
    • the CSS would not be compressed.

Status: unresolved. The post is asking for a reliable way to trigger rebuilding of CSS from Shopify section {% stylesheet %} blocks during automated file uploads.

Summarized with AI on March 6. AI used: gpt-5.4.

I am uploading several liquid files with sections {% stylesheet %} tag to my app users’ themes. However, when the liquid files are uploaded, the css in the stylesheet tag is not rebuilt. The issue causes my templates to look broken since some styles are missed

As a quick fix referring to this thread, I just add a space in the liquid file and save it. The missed css will be rebuilt again. But this is quite manual. My app users install my app and I hope everything can be automated.

Anyone can give me a hint?

I know that I can move up the css to the tag. But it’s not self-contained by the section and the css will not be compressed.