Skip to content

Refactor markup code block styles #30294

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 18 additions & 23 deletions web_src/css/markup/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
.markup h6 tt,
.markup h6 code {
font-size: inherit;
padding: 0.2em 0.4em;
background-color: var(--color-markup-code-block);
border-radius: var(--border-radius);
}

.markup h1 {
Expand Down Expand Up @@ -432,16 +435,6 @@
text-align: right;
}

.markup code:not(.code-inner),
.markup tt {
padding: 0.2em 0.4em;
margin: 0;
font-size: 85%;
white-space: break-spaces;
background-color: var(--color-markup-code-block);
border-radius: var(--border-radius);
}

.markup code br,
.markup tt br {
display: none;
Expand All @@ -451,15 +444,16 @@
text-decoration: inherit;
}

.markup pre > code {
padding: 0;
margin: 0;
font-size: 100%;
white-space: pre-wrap;
word-break: break-all;
overflow-wrap: break-word;
background: transparent;
border: 0;
/* for inline code blocks */
.markup p > code,
.markup li > code,
.markup p > tt,
.markup li > tt {
padding: 0.2em 0.4em;
font-size: 85%;
white-space: break-spaces;
background-color: var(--color-markup-code-block);
border-radius: var(--border-radius);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with this selector list. what about blockquote > code etc, you can't possibly list every single element here.


.markup .highlight {
Expand All @@ -484,14 +478,15 @@
word-wrap: normal;
}

/* for multiline code blocks */
.markup pre code,
.markup pre tt {
display: inline;
padding: 0;
line-height: inherit;
white-space: pre-wrap;
word-break: break-all;
word-wrap: normal;
overflow-wrap: break-word;

background-color: transparent;
border: 0;
}

.markup pre code::before,
Expand Down