cloud-annotations / docusaurus-openapi

🦕 OpenAPI plugin for generating API reference docs in Docusaurus v2.
https://docusaurus-openapi.netlify.app
MIT License
498 stars 82 forks source link

Fix: illegal value of colour #196

Closed yzhe819 closed 2 years ago

yzhe819 commented 2 years ago

Converting the hex short code #fff to the full six digit hex value #ffffff before passing the value to the editor.

This can fix the illegal value of token colour issue #183

netlify[bot] commented 2 years ago

Deploy Preview for docusaurus-openapi ready!

Name Link
Latest commit 003f6a73aaca9b5bfac383975b8c3dcc6dc4a4c5
Latest deploy log https://app.netlify.com/sites/docusaurus-openapi/deploys/62d33e0c2646070008d39792
Deploy Preview https://deploy-preview-196--docusaurus-openapi.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

yzhe819 commented 2 years ago

Before the merge, the UI of demo need to update. I will do that later.

screenshot ![图片](https://user-images.githubusercontent.com/68207314/179372306-ccf77502-5276-469d-af74-dc0522bed794.png)

Additionally, the documentation needs to remind users to add this --no-minify flag to existing projects

bourdakos1 commented 2 years ago

I think I would rather fix this by converting the hex short codes to the full 6 digit hex value before passing the value to the editor

yzhe819 commented 2 years ago

Thanks for your reply. I found the getColor function to get the property color value before passing it to the editor. https://github.com/cloud-annotations/docusaurus-openapi/blob/e5c0ec7fafda112cc3c4c297a4ae36e85f8e3552/packages/docusaurus-theme-openapi/src/theme/ApiDemoPanel/VSCode/index.tsx#L29 Just wanted to see if it's the correct place to modify.

yzhe819 commented 2 years ago

Style changes in demo have been reverted, ready to be merged 🎉