ci(primitives): transition to new css primitives#338
Draft
tmillr wants to merge 2 commits intoprojekt0n:mainfrom
Draft
ci(primitives): transition to new css primitives#338tmillr wants to merge 2 commits intoprojekt0n:mainfrom
tmillr wants to merge 2 commits intoprojekt0n:mainfrom
Conversation
30e2c35 to
7930b58
Compare
dbbeedc to
ba99973
Compare
Member
Author
Ideas and TODO
|
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. - `scale` no longer exists, but is still provided (by us) for backwards-compatibility and ergonomics. The new names are in the format of `base.color.red[4]` (for example to access `scale.red[5]`). The values in `scale` are 1-indexed for lua, but the original upstream names (in `base.color.*`) are 0-indexed and left untouched. - `scale.gray` no longer exists, use `scale.neutral` in its place - `*.subtle` variants no longer exist, see the link above for the corresponding replacements
8d5e284 to
9e2d42b
Compare
9e2d42b to
7972004
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thesame. See https://primer.style/foundations/primitives/migrating.
Source color primitives from
@primer/primitives/dist/internalCssinstead of
@primer/primitives/dist/css/functional/themesas only theformer 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
.defaulttonames/keypaths which are too short and would otherwise collide with
existing tables.
scaleno longer exists, but is still provided (by us) forbackwards-compatibility and ergonomics. The new names are in the
format of
base.color.red[4](for example to accessscale.red[5]).The values in
scaleare 1-indexed for lua, but the original upstreamnames (in
base.color.*) are 0-indexed and left untouched.scale.grayno longer exists, usescale.neutralin its place*.subtlevariants no longer exist, see the link above for thecorresponding replacements