-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Fix Accessibility Bug] Refactor code.js to improve syntax highlighting colors #1305
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
Merged
Conversation
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
Isn't this the kind of thing css styles is designed to solve? Can we not set this color based on the class in css? |
wraithgar
approved these changes
Oct 9, 2024
wraithgar
pushed a commit
that referenced
this pull request
Oct 10, 2024
…ken assign-left variable' (#1318) ## WHAT This pull request includes a small change to the `src/mdx/code.js` file. The change adds a new color mapping for the 'token assign-left variable' to the `colorMap` object. * [`src/mdx/code.js`](diffhunk://#diff-f3f4e897983cba6337e020c78ef03c356c88f8868bcd19c465eb3c07e8b96625R50): Added color mapping for 'token assign-left variable' in the `colorMap` object. ## BEFORE & AFTER <img width="375" alt="image" src="https://github.com/user-attachments/assets/f8bf78f4-f2cb-43b7-8b3c-e199e9ce9b33"> <img width="375" alt="image" src="https://github.com/user-attachments/assets/1af726ff-e629-4a60-a565-1d1278a9ff7d"> <img width="242" alt="image" src="https://github.com/user-attachments/assets/7f1db9d9-d4ea-470e-a5e5-aa91fad1125b"> <img width="242" alt="image" src="https://github.com/user-attachments/assets/58c1ca81-8799-4169-a3dd-5253afda5289"> ## Reference Missed in the [Previous PR](#1305)
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.
WHAT
This pull request includes changes to improve the syntax highlighting in the
src/mdx/code.js
file by introducing a color mapping for different token types and simplifying the code structure.Improvements to syntax highlighting:
src/mdx/code.js
: Added acolorMap
object to define custom colors for specific token types such as comments, parameter variables, and functions.Code simplification:
src/mdx/code.js
: Refactored theCode
component to use thecolorMap
for setting token colors, simplifying the logic for applying styles to tokens.WHY
BEFORE
AFTER