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

Minor docs bug/issue: example code blocks have unnecessary 30px right-margin #39245

Closed
3 tasks done
coliff opened this issue Sep 27, 2023 · 3 comments · Fixed by #39246
Closed
3 tasks done

Minor docs bug/issue: example code blocks have unnecessary 30px right-margin #39245

coliff opened this issue Sep 27, 2023 · 3 comments · Fixed by #39246

Comments

@coliff
Copy link
Contributor

coliff commented Sep 27, 2023

Prerequisites

Describe the issue

Example on: https://getbootstrap.com/docs/5.3/forms/form-control/#example

screen: (red border added by me to highlight issue more clearly)
image

The code block has a 30px right-margin. I assume this is because the CSS rule used:

@media (min-width: 992px)
.highlight pre {
  margin-right: 1.875rem;
}

This CSS is also used for .bd-code-snippet where there is no preview above and the code doesn't want to get in the way of the copy to clipboard button so it makes sense there.

Perhaps a quick easy fix could be to overrule the above, just for the examples.

.bd-example-snippet .highlight pre {
  margin-right: 0;
}

If you agree I'd be happy to make a quick PR.

Reduced test cases

see above:

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Microsoft Edge

What version of Bootstrap are you using?

v5.3.2

@julien-deramond
Copy link
Member

Thanks for opening this issue @coliff
Yes, as you pointed out, it was done so the code isn't in the way of the copy-to-clipboard button for cases like the ones in the homepage.
I don't remember if there was an edge case really forcing us to have this extra margin everywhere.

If you agree I'd be happy to make a quick PR.

Yep, you can try something and we will together try to find all the edge cases. Thanks for that :)

FYI, it's a bit hidden, but you have https://getbootstrap.com/docs/5.3/docsref/ that is supposed to reference these edge cases.

@sidharth2829

This comment was marked as resolved.

@coliff

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants