Summary
Until per-instance CSS scoping is fixed (see #556), block authors who follow the documented pattern [data-composition-id="my-comp"] { ... } will silently ship blocks that leak across sibling instances. A lint warning would catch this before it hits production rendering.
Suggested rule
For each composition file, parse its CSS (inline <style> and external .css referenced by <link>). For each rule whose selector contains [data-composition-id="<value>"] where <value> matches the file's own composition id (i.e., the value of data-composition-id on the root element):
Notes
- Severity should be
warning, not error: there are legitimate cases where the author wants the rule to apply to all instances (e.g., truly global block styling).
- Keep silent when the selector targets a different
data-composition-id value (legitimate cross-block targeting from a parent).
- Cross-reference real-world hit: https://github.com/sidorovanthon/anticodeguy-video-editing-studio file
docs/operations/planner-pipeline-fixes/findings.md items D15/D21.
Related
Generated by Claude Code (Opus 4.7).
Summary
Until per-instance CSS scoping is fixed (see #556), block authors who follow the documented pattern
[data-composition-id="my-comp"] { ... }will silently ship blocks that leak across sibling instances. A lint warning would catch this before it hits production rendering.Suggested rule
For each composition file, parse its CSS (inline
<style>and external.cssreferenced by<link>). For each rule whose selector contains[data-composition-id="<value>"]where<value>matches the file's own composition id (i.e., the value ofdata-composition-idon the root element):#<id>for instance-isolated styling until per-instance scoping is supported (see Nested compositions: sibling instances share CSS scope under attribute selectors #556)."Notes
warning, noterror: there are legitimate cases where the author wants the rule to apply to all instances (e.g., truly global block styling).data-composition-idvalue (legitimate cross-block targeting from a parent).docs/operations/planner-pipeline-fixes/findings.mditems D15/D21.Related
template_literal_selectoralready catches a separate authoring issue in the sameflowchartblock; useful precedent for catalog-block lint gating.Generated by Claude Code (Opus 4.7).