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: code blocks in preview #157

Merged
merged 6 commits into from
Nov 11, 2024
Merged

Conversation

dawidsawa
Copy link
Contributor

Resolves #155

@ubiquity-os-deployer
Copy link

ubiquity-os-deployer bot commented Nov 5, 2024

@dawidsawa
Copy link
Contributor Author

Before
before

After
after

@dawidsawa dawidsawa marked this pull request as ready for review November 5, 2024 16:17
@dawidsawa dawidsawa requested a review from 0x4007 as a code owner November 5, 2024 16:17
@zugdev zugdev self-requested a review November 5, 2024 17:40
@zugdev
Copy link
Collaborator

zugdev commented Nov 5, 2024

Please add overflow-x: scroll in code block, to handle issues like this one

image

Also consider adding a slightly darker background color for the code block.

@dawidsawa
Copy link
Contributor Author

Given the background is already very dark adding even an absolute black wouldn't be much visible anyway, so perhaps using a lighter background like here:
scroll-bg

@zugdev
Copy link
Collaborator

zugdev commented Nov 6, 2024

Please consider the inverted style too because when browser is in light mode the following happens:

image

Also:

  1. Add some padding so text is not too close to the code block's border. Notice that the biggest difference from our code block to GitHub's is padding:

image

image

  1. Make the font size inside the code block 12px, which is a tiny bit smaller, allowing for more content to be shown.

@dawidsawa dawidsawa changed the title Fix code blocks in preview fix: code blocks in preview Nov 6, 2024
@dawidsawa
Copy link
Contributor Author

How about now:

dark

light

@zugdev
Copy link
Collaborator

zugdev commented Nov 6, 2024

That's better, one last thing check this issue. The code block is unnecessarily overflowing to the right:

image

We want it to look like:

image

It seems it's because of the added padding. If you know a good solution that doesn't involve calc -32px, please use it.

@dawidsawa
Copy link
Contributor Author

dawidsawa commented Nov 7, 2024

EDIT: my bad, that did not fix it.

https://a642e753.devpool-directory-ui.pages.dev/?issue=2595388408

pre-overflow-fixed

@zugdev
Copy link
Collaborator

zugdev commented Nov 7, 2024

Looks good! Not sure about hard-coded colors tho, @0x4007 RFC

Copy link
Contributor

ubiquity-os bot commented Nov 11, 2024

@dawidsawa, this task has been idle for a while. Please provide an update.

@zugdev zugdev merged commit d42ffd7 into ubiquity:development Nov 11, 2024
1 of 2 checks passed
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.

expand code blocks in preview
2 participants