Skip to content

Generate Design CSS in the asset pipeline, not mix compile - #126

Open
karim-semmoud wants to merge 3 commits into
mainfrom
cursor/design-css-off-compile-d87b
Open

Generate Design CSS in the asset pipeline, not mix compile#126
karim-semmoud wants to merge 3 commits into
mainfrom
cursor/design-css-off-compile-d87b

Conversation

@karim-semmoud

@karim-semmoud karim-semmoud commented Aug 26, 2026

Copy link
Copy Markdown
Member

Design CSS is generated by mix corex.design.build as a Phoenix asset step (same layer as Tailwind/esbuild), not during mix compile.

Why

A Mix compiler is the wrong layer for CSS: it writes outside _build, hashes source trees on every compile, doubles work with assets.build, and breaks MIX_ENV=prod mix assets.deploy when corex_design is only: :dev.

Changes

  • Delete Mix.Tasks.Compile.CorexDesign.
  • Stop injecting :corex_design into compilers in mix corex.new / Tableau scaffolds and e2e.
  • Keep mix corex.design.build as the only generator, already wired through assets.build / assets.deploy.
  • Scaffold {:corex_design, "~> 0.2", runtime: false} in every Mix env (no only: :dev) so prod assets.deploy can run the Mix task.
  • e2e: runtime: false plus corex_design: :load in the release so Accessibility helpers stay in the Gigalixir slug. Mix.Release omits runtime: false apps unless listed. :load does not start Design or rebuild CSS.
  • --a11y request path only sets data-* on <html> (same as theme/mode). Preference CSS was already emitted by the design build.
  • Document corex_design: :load for generated --a11y apps that use mix release (Accessibility, Production).
  • Document Design CSS as an asset step; re-run mix corex.design.build after config :corex_design changes. mix compile does not regenerate CSS.

Test plan

  • Installer tests for mix.exs patches, generate, and Tableau templates
  • Design package tests (mix corex.design.build)
  • MCP tests for updated install snippets and design_guide a11y/mix release wording
  • e2e mix compile + mix corex.design.build + MIX_ENV=prod mix release (corex_design present in the slug)
Open in Web Open in Cursor 

Remove Mix.Tasks.Compile.CorexDesign and stop injecting :corex_design into
compilers. Keep mix corex.design.build as the only generator, wired through
assets.build / assets.deploy. Scaffold corex_design as runtime: false in every
Mix env so MIX_ENV=prod mix assets.deploy can run the task.

Co-authored-by: Karim Semmoud <karim-semmoud@users.noreply.github.com>
@karim-semmoud
karim-semmoud marked this pull request as ready for review August 26, 2026 10:41
cursoragent and others added 2 commits August 26, 2026 10:49
Mark corex_design as runtime: false like generated apps, load it in the
Gigalixir release so Accessibility helpers stay available, and hook
mix assets.deploy from the phoenix-static compile script so production
no longer relies on mix compile to emit CSS.

Co-authored-by: Karim Semmoud <karim-semmoud@users.noreply.github.com>
Preference CSS is still a mix corex.design.build asset. Runtime: false and
corex_design: :load are Mix packaging, not per-request generation. Document
mix release :load for --a11y apps.

Co-authored-by: Karim Semmoud <karim-semmoud@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants