Skip to content

Improve contrast of code blocks and tables#176

Open
panozzaj wants to merge 2 commits intoOWASP:mainfrom
panozzaj:main
Open

Improve contrast of code blocks and tables#176
panozzaj wants to merge 2 commits intoOWASP:mainfrom
panozzaj:main

Conversation

@panozzaj
Copy link
Copy Markdown

Hi, thanks for maintaining the OWASP sites!

I was looking at an issue on one of the sites that uses this www--site-theme but found it pretty hard to read, especially the code blocks:

image

As a result, I tweaked the code and table styles to have higher contrast and as a result, is a lot easier for me to read:

image

Would this be a useful contribution? I haven't worked with this codebase in the past, so I'm open to feedback on how to make it better.

Change code block background from #999 (mid-grey) to #f6f8fa (light
grey) and update syntax highlighting colors to meet WCAG 2.1 AA
minimum contrast ratio of 4.5:1.

Before: #999 background gave ~3.5:1 contrast with black text, and
syntax token colors (deepskyblue, darkkhaki, etc.) ranged from 1.9:1
to 3.9:1 — all failing WCAG AA.

After: #f6f8fa background with updated token colors all pass 4.5:1+.
Change $bg-grey from #98afc7 to #e2e8f0. The old value gave only
3.3:1 contrast with black text, failing WCAG AA (4.5:1). The new
value provides 17:1 contrast while keeping the alternating row
stripe visible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant