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

fix: copy button and horizontal scrollbar position in codeblocks #1309

Closed
wants to merge 2 commits into from

Conversation

janvi01
Copy link
Contributor

@janvi01 janvi01 commented Feb 8, 2023

Description

The PR fixes the scrollbar position and misalignment of copy button in code blocks on various doc pages.

The misalignment was caused due to code blocks wrapped within backticks instead of the codeblock.js component.

Screenshots -

Before
Screenshot 2023-02-08 at 10 51 57 AM

After
Screenshot 2023-02-08 at 10 52 21 AM

Related issue(s)
Fixes #1292

@netlify
Copy link

netlify bot commented Feb 8, 2023

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6ff8c6f
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/63e5b82738713c0007c78af5
😎 Deploy Preview https://deploy-preview-1309--asyncapi-website.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.

@github-actions
Copy link

github-actions bot commented Feb 8, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 36
🟠 Accessibility 88
🟢 Best practices 100
🟢 SEO 100
🔴 PWA 30

Lighthouse ran on https://deploy-preview-1309--asyncapi-website.netlify.app/

Copy link
Member

@akshatnema akshatnema left a comment

Choose a reason for hiding this comment

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

@janvi01 Based on the changes you made in the docs, they are not managed from this repository. For generator docs, the official documentation is maintained at generator repository. So, even if you change the backticks to the CodeBlock component, it will get rewrite once the workflow runs to update the docs in the website.

Also, you should ask first @alequetzalli whether all the Doc contributors will agree on using the <CodeBlock> component comfortably instead of backtick notation to write commands.

@quetzalliwrites
Copy link
Member

I don't think we can only use the codeblock element, I think we'll still use the ``` for some scenarios.

Thoughts @derberg O_O?

@janvi01
Copy link
Contributor Author

janvi01 commented Feb 10, 2023

I don't think we can only use the codeblock element, I think we'll still use the ``` for some scenarios.

Thoughts @derberg O_O?

When using backticks, there is a misalignment of the copy button position. I don't know what is the reason, but when using the code block element it works well maybe we can find out why it is happening.

@derberg
Copy link
Member

derberg commented Feb 28, 2023

@janvi01 @alequetzalli yup, we need a fix for both, the backticks and CodeBlock component.

@janvi01
Copy link
Contributor Author

janvi01 commented Mar 6, 2023

Closing this PR as this is not the appropriate solution, I have changed the backticks and codeblock css both in #1401

@janvi01 janvi01 closed this Mar 6, 2023
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.

Fix copy button position in docs command block
4 participants