-
-
Notifications
You must be signed in to change notification settings - Fork 450
Better inline code #3269
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
base: main
Are you sure you want to change the base?
Better inline code #3269
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,3 +1,6 @@ | ||||
| $color-code-background: #272822; | ||||
| $color-code-color: #f8f8f2; | ||||
|
|
||||
| :root { | ||||
| --page-max-width: 57rem; | ||||
| --page-with-toc-max-width: 81rem; | ||||
|
|
@@ -117,9 +120,10 @@ ol:last-child { | |||
| } | ||||
|
|
||||
| pre { | ||||
| background-color: $color-code-background; | ||||
| padding: 1rem; | ||||
| overflow: auto; | ||||
| border-radius: 4px; | ||||
| border-radius: 0.3rem; | ||||
| } | ||||
|
|
||||
| // The line numbers already provide some kind of left/right padding | ||||
|
|
@@ -206,15 +210,31 @@ pre table { | |||
| } | ||||
| } | ||||
|
|
||||
| :not(pre)>code { | ||||
| color: #f54029; | ||||
| border: 1px solid #f54029; | ||||
| border-radius: 4px; | ||||
| padding: 0 .4rem; | ||||
| code { | ||||
| background-color: $color-code-background; | ||||
| color: $color-code-color; | ||||
| border-radius: 0.3rem; | ||||
| padding: 1px 5px 2px; | ||||
| font-size: 0.8em; | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I don't think we need to decrease the size of the text. Keeping it the same size ensures consistency, which I believe is something we should strive for in this situation.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason here is that with all the border and background it always felt larger than the rest. Hence this tried to visually match the surroundings. But maybe thats just me
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this one is subjective. For me the .8 makes inline code hard(er) to read in text blocks because the font size changes in the flow. |
||||
| white-space: nowrap; | ||||
| } | ||||
|
|
||||
| h1, h2, h3, h4, h5, h6 { | ||||
| code { | ||||
| font-size: 0.75em; | ||||
| padding-top: 0; | ||||
| } | ||||
| } | ||||
|
|
||||
| pre code { | ||||
| white-space: inherit; | ||||
| font-size: inherit; | ||||
| padding: 0; | ||||
| background-color: transparent; | ||||
| border-radius: 0; | ||||
| } | ||||
|
|
||||
| a>code { | ||||
| border-color: var(--color-link); | ||||
| color: var(--color-link); | ||||
| } | ||||
|
|
||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to talk about units in general. If you use absolute units for the paddings and relative units for the font size, then people with other base font sizes will have misaligned code blocks.