projekt0n / github-nvim-theme

GitHub's Neovim themes
MIT License
2.11k stars 106 forks source link

ci(primitives): transition to new css primitives #338

Open tmillr opened 3 months ago

tmillr commented 3 months ago

GitHub no longer distributes primitives in JSON format. Also, the names of the values (i.e. CSS variables) have changed. Most of the new names correspond 1-to-1 with one of the old names. Some colors have also changed slightly (e.g. fg-default), but otherwise remain mostly the same. See https://primer.style/foundations/primitives/migrating.

Source color primitives from @primer/primitives/dist/internalCss instead of @primer/primitives/dist/css/functional/themes as only the former directory contains the base colors (scales).

Convert new primer css primitives/variables directly to lua in .github/workflows/csstolua.lua (runs in CI). This script generates some debugging info in case an error occurs (which can be found in CI logs). Convert to a nested table structure for idiomatic usage in lua. The primitives table now provides type-hints via lsp, and accessing invalid names at runtime will throw an error. Append .default to names/keypaths which are too short and would otherwise collide with existing tables.

tmillr commented 2 months ago

Ideas and TODO