-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: syntax tokens #57
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for red-hat-design-tokens ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
539049f
to
80c300a
Compare
OK @coreyvickery this is ready for you to tinker with. To get set up, check out this branch
Then clean out your working directory (save any uncommitted changes, they may be deleted)
Next install dependencies
Then start the 11ty dev server
Once that's ready, you can change the values in You can uncomment any of the commented tokens and add values to see how they will reflect on the page. You can add markdown fenced code blocks to |
80c300a
to
d4333d5
Compare
@marionnegp Tagging you to take over. |
@bennypowers, I've been trying to match up the Prism JS tokens with the XD mockups, and I'm wondering how Prism is matching tokens to pieces of the code. For example, in the screenshot below Is there a way to change this (maybe using Prism's Custom Class plugin)? Would that be a lot to manage in the future? |
@marionnegp if i understood correctly, you mean we should customize prism's parser to highlight tokens that it doesn't already, or to highlight them differently. If we went that route, we'd have to then also require all our users to implement a custom version of prism's parser whenever using our tokens, in order to get consistent results, and I think that's prohibitively complex for a user that just wants to theme a syntax snippet. we could try highlighting with highlight.js instead, which is also quite popular. |
@bennypowers, yeah, that level of complexity was what I was afraid of. I think we should try highlight.js instead. @coreyvickery had used the highlight.js demos as a guide and tweaked the color, so it should be easier to update token colors. |
|
@bennypowers, could you add highlight.js here instead of Prism.js? Does it cause any issues to use Prism in PFE and Highlight here? |
prism is the default in 11ty, but we can override that for the sake of the token pages, which I've done in the most recent commits. This is getting at a deeper problem which is that we should prefer not to tie our token names to a given library. So let's say we got things worked out using highlight JS, and using their token names in our token names. What if we get a request for prism.js support? treesitter? vscode? |
The current state of the PR encodes our color token names using highlightjs' syntax token names. The result is that the DP (as of 3c5a412) looks more-or-less like the XD, but this will be difficult to maintain and port to other syntax highlighting schemes like vscode, treesitter, or prism (which is the default highlighter for 11ty) I think the way forward is:
For reference, here are the highlight groups that nvim treesitter uses
|
leaving this here for future reference: https://dbanks.design/blog/vs-code-theme-with-style-dictionary/#Syntax-styles |
I used this syntax highlighting spreadsheet to match Tree-sitter tokens to what we have in this XD as best as I could. If I wasn't sure whether there was any code from the XD mockup that matched, I left a @bennypowers, I can try installing Tree-sitter and working to add these if that would be the next step. |
@marionnegp I resolved the conflicts in this branch. b60bf62 looks nice! Build fails for good reasons: we need to realign syntax greys to the new grey tokens |
Update on syntax highlighting colors posted here. |
commit f54e53e Author: Marionne Patel <[email protected]> Date: Mon Feb 26 11:13:00 2024 -0500 feat: update danger status tokens (#131) * feat: change value of --rh-color-status-danger-on-light * feat: add --rh-color-icon-status color tokens * fix: add `on-dark` for warning icon color * feat: add changeset commit b64dd32 Author: Marionne Patel <[email protected]> Date: Mon Jan 15 09:31:06 2024 -0500 feat: add status color tokens (#124) * feat: add status color tokens, fix a duplicated red orange value, change the max width of the copy button to show full token name, and change order of categories on Netlify page * feat: add descriptions * docs: add changeset * feat: group surface status colors with other surface tokens * fix: remove space * feat: change neutral status to default and note status to info * feat: remove caution status colors and add -status to border and surface status tokens * feat: update changeset --------- Co-authored-by: Benny Powers <[email protected]> commit 9539e1d Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed Dec 13 10:59:13 2023 +0200 chore: prepare release (#125) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> commit 3c18e2c Author: Benny Powers <[email protected]> Date: Wed Dec 13 10:18:26 2023 +0200 fix: allow component token names commit a5dfee5 Author: Marionne Patel <[email protected]> Date: Wed Dec 6 07:05:03 2023 -0500 feat: create a new folder under assets to house breakpoint images (#120) Co-authored-by: Benny Powers - עם ישראל חי! <[email protected]> commit b020c49 Author: Mark Caron <[email protected]> Date: Wed Dec 6 03:45:56 2023 -0500 docs: update README.md (#122) Adding stylized alert/admonition for the NOTE commit 4c64dfc Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon Dec 4 12:58:55 2023 -0500 chore: prepare release (#115) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> commit 9759846 Author: Benny Powers - עם ישראל חי! <[email protected]> Date: Mon Dec 4 16:59:42 2023 +0200 docs: correct stylelint rule name (#121) commit 41125df Author: Marionne Patel <[email protected]> Date: Sun Dec 3 03:23:12 2023 -0500 feat: update crayon colors with new brand colors (#119) * feat: update crayon colors with new brand colors * feat: update semantic token values with new crayon tokens * fix: fix typo in interactive tokens file, add code comments * feat: add changeset with crayon color updates * feat: add semantic token value changes to changeset * feat: update token names in stylelint README migration example * fix: remove empty keys * feat: replace crayon color tables with migration rules and list of tokens new to 2.0 * feat: added use cases when applicable, fixed a blue migration rule, and updated a brand token values * docs: apply suggestions from code review * docs: update .changeset/add-new-brand-colors.md --------- Co-authored-by: Benny Powers - עם ישראל חי! <[email protected]> commit c793fd8 Author: Benny Powers <[email protected]> Date: Thu Jun 8 19:14:14 2023 +0300 feat(editor): make css var fallback values placeholders (#114) * feat(editor): make css var fallback values placeholders This lets users more easily choose between the fallback and non-fallback forms ```css padding: var(--rh-space-xs, 4px); margin: var(--rh-space-xs); ``` * docs: add changeset commit b059238 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu May 25 10:56:22 2023 -0400 chore: prepare release (#112) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> commit f820df6 Author: Steven Spriggs <[email protected]> Date: Thu May 25 10:54:24 2023 -0400 fix: ensure cjs files are included in package (#111) * fix: ensure cjs files are included in package * chore: update changeset * chore: update changeset commit fa73870 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed May 24 11:06:04 2023 -0400 chore: prepare release (#109) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> commit a777f24 Author: Michael Potter <[email protected]> Date: Wed May 24 11:03:58 2023 -0400 fix: missing file exports (#108) * fix: made typescript compile a dep of style-dictionary * chore: added changeset * chore: changset commit 1485cea Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue May 23 13:30:26 2023 -0400 chore: prepare release (#105) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> commit c80fea2 Author: Steven Spriggs <[email protected]> Date: Tue May 23 11:20:40 2023 -0400 chore: missing script for types in release workflow (#104) commit 0766863 Author: Steven Spriggs <[email protected]> Date: Thu May 18 13:21:25 2023 -0400 feat: add meta data token export (#103) * feat: add meta data token export * chore: update comment * fix: export entire token object in meta entries * docs: update lib/formats/map.js * docs: update lib/formats/map.js --------- Co-authored-by: Benny Powers <[email protected]> commit d35d8a2 Author: Ivana Rodriguez <[email protected]> Date: Mon Apr 24 09:33:30 2023 -0400 fix: plugin filename should match release tag (#102) * fix: plugin filename should match release tag * fix: throw error if filename doesn't match * ci: break out package step and run after version bump
based on #55
closes #16