Shopify / Shopify/liquid

Stylesheet content subsetting : theme bundles every {% stylesheet %} instead of subsetting

Open
#2,115 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

This concerns Shopify-hosted theme stylesheet compilation. If this issue belongs outside this repository, could you point me in the right direction?

Expected behavior

According to Stylesheet content subsetting and the April 2026 changelog, the linked compiled stylesheet should contain CSS from the sections, blocks and snippets in the current page's render tree.

Observed behavior

On a development theme (tried live too), compiled_assets/styles.css contains CSS from all 22 local Liquid files with a {% stylesheet %} tag. This includes optional blocks that are absent from the homepage template and whose elements are absent from its rendered HTML.

Reproduction on this preview

  1. Open the preview URL above, rather than the local development server.
  2. Verify Shopify.theme.id === 182588145987 in the browser console.
  3. Inspect the compiled_assets/styles.css request and its linked source map.
  4. Search the source map for START_BLOCK:_grid-stat-maxdesign and START_BLOCK:_grid-discount-maxdesign (or search the stylesheet for .gmd__stat and .gmd__discount).
  5. Compare these with the homepage template's block tree and the rendered page. These optional blocks are not configured on the homepage and their elements are absent, but their styles are included.

The files use static {% stylesheet %} tags appended to their respective sections, theme blocks and actual markup snippets. Shared styles live in the parent section.

Questions for the platform team

  • Hint: does block schema availability or a static block render cause the entire allowed block tree to be included, even when those optional blocks are not configured on the page?
  • If neither is expected, can this be investigated as a server-side subsetting bug?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the preview URL and inspect the compiled_assets/styles.css request and its linked source map, then compare them with templates/index.json and the rendered HTML. The investigation is complete when the platform team determines why absent blocks such as _grid-stat-maxdesign and _grid-discount-maxdesign are included, or confirms and addresses a server-side subsetting bug.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.