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

Refine our inline code style #837

Closed
choldgraf opened this issue Jul 23, 2022 · 3 comments · Fixed by #838
Closed

Refine our inline code style #837

choldgraf opened this issue Jul 23, 2022 · 3 comments · Fixed by #838

Comments

@choldgraf
Copy link
Collaborator

choldgraf commented Jul 23, 2022

Context

Currently we are using the default Bootstrap style for inline code:

image

This is an issue to discuss whether people prefer a different kind of style.

I think the most common alternative would be something that also defines a background to the inline code span, to make it stand out a bit more, and feel more similar to code blocks. A few examples from our inspiration themes:

Source Img
Docker image
GitBook image
Furo image
Material mkdocs image
Docasaurus image
JupyterLab image

After digging up all of these examples, I promise I didn't know this ahead of time but it looks like all of them define a background for their inline code. Maybe we should consider doing the same?

Example

I did a quick experiment, and if we add the following CSS lines:

code span.pre {
    background-color: var(--pst-color-surface);
    border: 1px solid var(--pst-color-border);
    border-radius: 0.25rem;
    padding: 0.1rem 0.2rem;
    color: var(--pst-color-text-base);
}

We get this effect:

image

Or with color primary:

image

@12rambau
Copy link
Collaborator

For me this code styling was the pandas documentation signature but I also know that people find it disturbing. I'm perfectly happy with the solution that use "color primary" as it continues to stand out.

@choldgraf
Copy link
Collaborator Author

As an iterative step forward, we could just try adding the background and leaving the color as-is?

e.g.:

code.literal {
	  padding: 0.1rem 0.25rem;
	  background-color: var(--pst-color-surface);
	  border: 1px solid var(--pst-color-on-surface);
	  border-radius: 0.25rem;
}

results in:

chrome_xQLhR6cnr3

@drammock
Copy link
Collaborator

I don't mind adding a background to inline code spans. I'm not a big fan of putting borders around it though. If it must have borders please make them very subtle

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 a pull request may close this issue.

3 participants