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

Refactor code block styles #516

Merged
merged 2 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
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
52 changes: 29 additions & 23 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -668,37 +668,43 @@ pre {
font-size: 16px;
line-height: 1.5em;
}
pre code {
white-space: pre;
}
pre.highlight, .highlight > pre, td.code pre {
background-color: #FAFAFA;
background-image: linear-gradient(#F9F9F9 50%, #FDFDFD 50%);
background-repeat: repeat;
background-size: 3em 3em;
background-position: 0px 10px;
border-left: 7px solid #444;
}
code table, code table td, code table th, code table tbody, code table tr,
td.gutter pre {
padding: 0;
.highlight pre {
border: none;
background-color: #fff;
background: none;
margin: 0;
}
.highlight > pre {
background-image: linear-gradient(
rgba(0,0,0,0.06), rgba(0,0,0,0.06) 1.5em, rgba(0,0,0,0.03) 1.5em, rgba(0,0,0,0.03) 3em);
background-size: auto 3em;
background-position-y: 10px;
border: 1px solid rgba(0,0,0,0.1);
border-left: 7px solid #444;
}
.highlight > pre:not([class~="highlight"]) { /* code block with line number */
padding: 0;
}
.highlight > pre.highlight {
padding: 9.5px;
.highlight table, .highlight tr, .highlight td { /* to be removed after fixing table styles */
border: none;
background: none;
padding: 0;
margin: 0;
}
td.code pre {
border-width: 0 0 0 2px;
border-style: solid;
border-color: #444;
.highlight pre.lineno {
color: rgba(0,0,0,0.3);
border-radius: 0;
border-right: 2px solid #444;
}

/* Make line numbers unselectable: excludes line numbers from copy-paste user ops */
.lineno {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
td.gutter {
padding-top: 3px;
.lineno::selection, .lineno::-moz-selection {
background: none;
}

/* --- Social media sharing section --- */
Expand Down
5 changes: 0 additions & 5 deletions css/pygment_highlights.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,3 @@
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */

/* Make line numbers unselectable: excludes line numbers from copy-paste user ops */
.highlight .lineno {color:rgba(0,0,0,0.3);padding: 0 10px;-webkit-user-select: none;-moz-user-select: none; -o-user-select: none;}
.lineno::-moz-selection {background-color: transparent;} /* Mozilla specific */
.lineno::selection {background-color: transparent;} /* Other major browsers */