evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in SQL and markdown
https://evidence.dev
MIT License
4.5k stars 216 forks source link

[Bug]: 'colors.color.1' does not exist in your theme config. #2634

Open archiewood opened 1 month ago

archiewood commented 1 month ago

Describe the bug

After upgrading to Evidence, with a custom app.css file defined in the root of the project, the following error is thrown, and the dev server will not start

Pre-transform error: [postcss] /xxx/.evidence/template/src/app.css:234:3: 'colors.color.1' does not exist in your theme config.

Steps to Reproduce

Define an app.css file in the root of your project, containing the previously defined colour constants

--color1: theme(colors.color.1);
--color2: theme(colors.color.2);
--color3: theme(colors.color.3);
--color4: theme(colors.color.4);
--color5: theme(colors.color.5);
--color6: theme(colors.color.6);
--color7: theme(colors.color.7);
--color8: theme(colors.color.8);
--color9: theme(colors.color.9);
--color10: theme(colors.color.10);
--color11: theme(colors.color.11);
--color12: theme(colors.color.12);
--color13: theme(colors.color.13);
--color14: theme(colors.color.14);
--color15: theme(colors.color.15);
--color16: theme(colors.color.16);
--color17: theme(colors.color.17);
--color18: theme(colors.color.18);
--color19: theme(colors.color.19);
--color20: theme(colors.color.20);

Severity

blocking all usage of Evidence

Workarounds

This is caused by: https://github.com/evidence-dev/evidence/commit/f50f8c4c2759340303ef5733d021a46a7b05fdd1

To work around it either:

  1. Delete any references to --colorX: theme(colors.color.X); in your theme file
  2. Delete your entire app.css file, and fetch the latest from the https://github.com/evidence-dev/evidence/blob/next/sites/example-project/src/app.css, and integrate any edits you have made