Skip to content

Commit 5599acf

Browse files
authored
[Fix Accessibility Bug] improve accessibility of syntax highlighting by adding string token color (#1715)
### Fix Accessibility Bug - Improve Syntax Highlighting Colors for Code Blocks - **File Changes** code.js - Added string token color mapping to improve syntax highlighting accessibility - **Summary** This PR enhances code block syntax highlighting accessibility by adding a specific color (#db1068) for string tokens to improve visual contrast and readability. ## BEFORE <img width="600" height="199" alt="image" src="https://github.com/user-attachments/assets/32825831-8230-4e8d-a298-a19cfff7bf4d" /> <img width="180" height="437" alt="image" src="https://github.com/user-attachments/assets/e2ae8ce4-7474-45d9-9cb4-fd62eb39ae98" /> ## AFTER <img width="600" height="188" alt="image" src="https://github.com/user-attachments/assets/def9ec13-8d61-47f3-8d18-a34247d97d88" /> <img width="180" height="437" alt="image" src="https://github.com/user-attachments/assets/4bca70be-d2b6-4a81-bf0e-821e16dd2245" />
1 parent d0695a6 commit 5599acf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mdx/code.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const colorMap = {
4949
'token function': '#cf3846',
5050
'token parameter variable': '#277d7b',
5151
'token assign-left variable': '#277d7b',
52+
'token string': '#db1068',
5253
}
5354

5455
const MonoText = props => <Text sx={{fontFamily: 'mono', fontSize: 1}} {...props} />

0 commit comments

Comments
 (0)