Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xianmin/hugo-theme-jane.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Xianmin <xianmin12@gmail.com>2018-07-21 18:40:33 +0300
committerChen Xianmin <xianmin12@gmail.com>2018-07-22 06:41:07 +0300
commit05f8d2035a87d70e74b010dab88d04162cb497f9 (patch)
treed3d3b46e7970c58a1a4825fc3784437f3c190547
parent3b3dff320fc4be7893eb8ad429cda292fd138618 (diff)
fix: code block row alignment
-rw-r--r--src/css/_partial/_post/_chroma_highlight.scss4
-rw-r--r--src/css/_partial/_post/_code.scss37
2 files changed, 17 insertions, 24 deletions
diff --git a/src/css/_partial/_post/_chroma_highlight.scss b/src/css/_partial/_post/_chroma_highlight.scss
index ccd668e..461d295 100644
--- a/src/css/_partial/_post/_chroma_highlight.scss
+++ b/src/css/_partial/_post/_chroma_highlight.scss
@@ -35,9 +35,9 @@
/* LineNumbersTable */
-.chroma .lnt {
+.chroma .lntd:first-of-type {
margin-right: 0.4em;
- padding: 0 0.4em 0 0.4em;
+ padding: 0 0.8em 0 0.4em;
}
/* LineNumbers */
diff --git a/src/css/_partial/_post/_code.scss b/src/css/_partial/_post/_code.scss
index 8c65cf4..e4e4ba9 100644
--- a/src/css/_partial/_post/_code.scss
+++ b/src/css/_partial/_post/_code.scss
@@ -1,3 +1,8 @@
+// ==============================
+// Post code
+// ==============================
+
+// normal <code> style
code {
padding: 0 7px;
background: $code-background;
@@ -10,20 +15,22 @@ code, pre {
font-family: $code-font-family;
}
-.chroma {
- margin: 0;
-
- code {
- padding: 0;
- color:inherit;
- }
-}
+// chroma code block style
.highlight > .chroma {
margin: 1em 0;
overflow-x: auto;
position: relative;
border: 2px solid #dddddd;
+ line-height: 1.6;
+
+ code {
+ padding: 0; /* remove normal code padding */
+ }
+
+ pre {
+ margin: 0; /* remove normal pre margin */
+ }
table {
position: relative;
@@ -47,22 +54,8 @@ code, pre {
text-transform: capitalize;
}
- tr, td {
- margin: 0;
- padding: 0;
- width: 100%;
- border-collapse: collapse;
- }
-
- tr>td:first-child {
- width: 1%;
- white-space: nowrap;
- }
-
.lnt {
color: $gray;
- display: block;
- line-height: 2em;
}
}