-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Publish variables.json #949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
|
JFYI, for some reason this deployed without a hitch when I ran |
|
This is awesome.. 😍 No more hunting in Using a |
Yeah, I agree. I had it as a table initially, but some of the long variable names made the distance between short names and their values value too big for my taste.
There aren't any groupings yet, though we could group them by, say, whether they're a color or not. I wonder if this would work better as more of a code-oriented view where we're inlining the source and "enhancing" the values with swatches? Like, maybe we actually show the source: css/src/support/variables/color-system.scss Lines 3 to 13 in 03f5ac4
css/src/support/variables/colors.scss Lines 4 to 36 in 03f5ac4
...like this? (mocked up in the inspector) |
Hmm.. interesting. It would solve the "grouping" since we already do that in $gray-500: #6a737d; // Aliases: $gray, $text-gray-light
$repo-private-bg: $yellow-000; // #fffdef |
And linked to the corresponding declaration! 🤓 |
81c7695 to
ce034c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
On the docs side, there is a new Variables page that dumps all of this information.(Let's revisit this in another PR.)
🍀 Luckily, this still seems to work: https://primer-css.primer.now.sh/css/support/variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, otherwise looks great
| const meta = {bundles} | ||
| return writeFile(join(outDir, 'meta.json'), JSON.stringify(meta, null, 2), encoding) | ||
| }) | ||
| .then(writeVariableData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#925 contains the async/await change to this script and this change will need to be included there

This introduces a JSON payload containing information about all of the SCSS variables, their values, and references between them.
On the docs side, there is a new Variables page that dumps all of this information.(Let's revisit this in another PR.)/cc @BinaryMuse ❤️