Skip to content
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

Add color coding to the to standards table in the docs page #211

Conversation

cah-patrickthiem
Copy link
Contributor

@cah-patrickthiem cah-patrickthiem commented Jul 11, 2024

Added the color mapping with a react component. Needed to change the overview.md file to .mdx format.

related issue: 445

@cah-patrickthiem
Copy link
Contributor Author

Regarding colors and high contrast ratio:
I did use a contrast checker to pick the colors in contrast especially to the link color. I always made sure "WCAG AA" was met in normal text.
To be sure the colors match each other I used "HSL" ratio in the color picker.

The colors I picked are all relatively light pastel colors:
red: deprecated
yellow: draft
green: stable
blue: effective

However, if you wish other colors, please give feedback. Also the stable and effective colors could be swapped imo.

@cah-patrickthiem
Copy link
Contributor Author

looks like this:
image

Copy link
Contributor

@mbuechse mbuechse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! I would like to build something based on this, and I think 95 % of your work can be used for that. I have the following desiderata:

  • I have the impression that the colors are being set using plain JavaScript. So I would try to not use React, but onload or something.
  • I absolutely hate that the whole populateStds.js has been reformatted. I would like to keep reformatting and semantic change separate (using separate PRs). But I don't even see the need for the reformatting.

@cah-patrickthiem
Copy link
Contributor Author

Good work! I would like to build something based on this, and I think 95 % of your work can be used for that. I have the following desiderata:

  • I have the impression that the colors are being set using plain JavaScript. So I would try to not use React, but onload or something.
  • I absolutely hate that the whole populateStds.js has been reformatted. I would like to keep reformatting and semantic change separate (using separate PRs). But I don't even see the need for the reformatting.

Regarding react: I used react here, because the docusaurus documentation says that if you want to enrich markdown with more features (e.g. coloring), use react: see here
In general it is plain js code, but in order to be parsed by docusaurus, we need that little react "useEffect" function there. Besides that, no further react stuff is used. I tested it also with <script> tags, but that did not work.
If you have another idea I am not aware of, let me know.

Second, the reformatting was somehow done automatically, I'll try to figure out why and reverse it.

@mbuechse
Copy link
Contributor

I probably won't become a fan of Docusaurus, but so be it. Thanks for the explanation!

Copy link
Contributor

@mbuechse mbuechse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just one minor thing: dark mode. Maybe we can postpone dark mode. If you can address it right away, all the better.

@cah-patrickthiem
Copy link
Contributor Author

LGTM. Just one minor thing: dark mode. Maybe we can postpone dark mode. If you can address it right away, all the better.

Well, I think the colors also work in dark mode, at least regarding the signaling purpose, for sure the colors do not match the dark background in an esthetic way.

I would need to investigate on how to implement this.

Here is a screenshot in dark mode. If that is ok for you right now, we can merge it for now imo. Let me know what you prefer.
image

@mbuechse
Copy link
Contributor

I have already approved it, noting that we can postpone dark mode. Go ahead!

@cah-patrickthiem cah-patrickthiem merged commit 6b15ee2 into main Jul 22, 2024
2 of 4 checks passed
@cah-patrickthiem cah-patrickthiem deleted the 445-standards-repo-add-redundant-color-mapping-to-standards-table branch July 22, 2024 11:47
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.

None yet

2 participants