Stylesheet content subsetting : theme bundles every {% stylesheet %} instead of subsetting
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.
- Preview theme ID:
182588145987 - Preview: https://storec-x57979521.myshopify.com/?preview_theme_id=182588145987
- Compiled CSS observed: https://dansmagamelle.fr/cdn/shop/t/37/compiled_assets/styles.css?v=30287380357570781301788808102
- The CSS source map lists all 22 stylesheet-bearing files, including
_grid-stat-maxdesign,_grid-discount-maxdesignand unrelated product-details snippets. templates/index.jsoncontains zero Stat blocks and zero Discount blocks. The response HTML contains zero.gmd__statelements and zero.gmd__discountelements, but their CSS is present.
Reproduction on this preview
- Open the preview URL above, rather than the local development server.
- Verify
Shopify.theme.id === 182588145987in the browser console. - Inspect the
compiled_assets/styles.cssrequest and its linked source map. - Search the source map for
START_BLOCK:_grid-stat-maxdesignandSTART_BLOCK:_grid-discount-maxdesign(or search the stylesheet for.gmd__statand.gmd__discount). - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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