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

Inappropriate padding in code blocks #13299

Closed
1 of 2 tasks
wackerow opened this issue Jul 1, 2024 · 8 comments · Fixed by #13303
Closed
1 of 2 tasks

Inappropriate padding in code blocks #13299

wackerow opened this issue Jul 1, 2024 · 8 comments · Fixed by #13303
Assignees
Labels
bug 🐛 Something isn't working good first issue Good item to try if you're new to contributing help wanted Extra attention is needed or someone is needed to help

Comments

@wackerow
Copy link
Member

wackerow commented Jul 1, 2024

Describe the bug

The Codeblock component is used to render various types of code snippets from the triple-backtick markdown syntax (```). These blocks currently do not have appropriate padding applied to them.

To reproduce

  1. Go to https://ethereum.org/en/developers/tutorials/all-you-can-cache (or any page with code snippets)
  2. Scroll down to some code snippets
  3. Notice the lack of padding on the bottom of the code blocks

Expected behavior

Codeblocks should have 1.5rem padding-bottom applied to improve readability

Screenshots

image

Desktop (please complete the following information)

No response

Smartphone (please complete the following information)

No response

Additional context

Note that some codeblocks have a "copy" button added to it which alters the top padding; this should remain unchanged. The codeblocks without the copy button use 24px (1.5rem, size token 6) for the top padding; I would recommend we use the same for the bottom.

Similarly, some code blocks are longer than others... there is a max-height applied initially, with a "Show all" button for longer blocks. In those cases, we do not need padding if there is more code to scroll to, but once we're at the bottom there should be padding.

Would you like to work on this issue?

  • Yes
  • No
@wackerow wackerow added bug 🐛 Something isn't working help wanted Extra attention is needed or someone is needed to help good first issue Good item to try if you're new to contributing labels Jul 1, 2024
@github-actions github-actions bot added the needs triage 📥 This issue needs triaged before being worked on label Jul 1, 2024
@Baystef
Copy link
Contributor

Baystef commented Jul 1, 2024

Describe the bug

The Codeblock component is used to render various types of code snippets from the triple-backtick markdown syntax (```). These blocks currently do not have appropriate padding applied to them.

To reproduce

  1. Go to https://ethereum.org/en/developers/tutorials/all-you-can-cache
  2. Scroll down to some code snippets
  3. Notice the lack of padding on the bottom of the code blocks

Expected behavior

Codeblocks should have 1.5rem padding-bottom applied to improve readability

Screenshots

image ### Desktop (please complete the following information) _No response_

Smartphone (please complete the following information)

No response

Additional context

Note that some codeblocks have a "copy" button added to it which alters the top padding; this should remain unchanged. The codeblocks without the copy button use 24px (1.5rem, size token 6) for the top padding; I would recommend we use the same for the bottom.

Similarly, some code blocks are longer than others... there is a max-height applied initially, with a "Show all" button for longer blocks. In those cases, we do not need padding if there is more code to scroll to, but once we're at the bottom there should be padding.

Would you like to work on this issue?

  • Yes
  • No

@wackerow wackerow removed the needs triage 📥 This issue needs triaged before being worked on label Jul 1, 2024
@wackerow
Copy link
Member Author

wackerow commented Jul 1, 2024

Hey @Baystef hah are you trying to say "Yes" you'd like to work on this?

@Baystef
Copy link
Contributor

Baystef commented Jul 1, 2024

Hey @Baystef hah are you trying to say "Yes" you'd like to work on this?

Yes, please @wackerow

@wackerow
Copy link
Member Author

wackerow commented Jul 1, 2024

Great, thanks! Assigning =)

@sandeepV2
Copy link
Contributor

@wackerow @Baystef I see this behaviour across all the tutorial pages. Sorry but, Couldn't resist to solve it.

@Baystef
Copy link
Contributor

Baystef commented Jul 2, 2024

@wackerow @Baystef I see this behaviour across all the tutorial pages. Sorry but, Couldn't resist to solve it.

interesting

@wackerow
Copy link
Member Author

wackerow commented Jul 2, 2024

Looping back, appreciate the patch @sandeepV2... @Baystef apologies for the override, mind if we re-assign and find another one for ya? Would check out the unassigned "good first issues" if you're interested!

@wackerow wackerow assigned sandeepV2 and unassigned Baystef Jul 2, 2024
@Baystef
Copy link
Contributor

Baystef commented Jul 2, 2024

Looping back, appreciate the patch @sandeepV2... @Baystef apologies for the override, mind if we re-assign and find another one for ya? Would check out the unassigned "good first issues" if you're interested!

Sure, I'll look through and tag you to it

wackerow added a commit that referenced this issue Jul 14, 2024
Adds bottom padding to code block [Fixes #13299]
This was referenced Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working good first issue Good item to try if you're new to contributing help wanted Extra attention is needed or someone is needed to help
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants