Skip to content

Commit

Permalink
refactor: load highlight, emphasis-point on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Jan 10, 2020
1 parent 5e7b9cc commit bd6ca2b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 38 deletions.
9 changes: 9 additions & 0 deletions assets/scss/_common/emphasis-point.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.emphasis-point {
font-weight: normal;
text-emphasis: '';
-webkit-text-emphasis: '';
-moz-text-emphasis: '';
text-emphasis-position: under;
-webkit-text-emphasis-position: under;
-moz-text-emphasis-position: under;
}
25 changes: 25 additions & 0 deletions assets/scss/_common/highlight.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.highlight {
font-size: 0.8em;
margin: ($fontSize * 2) 0;
pre {
margin: 0 !important;
overflow: auto hidden;
background-color: unset;
}
th, td {
font-size: inherit;
}
table > tbody > tr:nth-of-type(odd) {
background-color: inherit;
}
table > tbody > tr:hover {
background-color: inherit;
}
}
span.lnt {
user-select: none;
display: block;
margin-right: -1em !important;
padding: 0 !important;
text-align: right;
}
37 changes: 1 addition & 36 deletions assets/scss/_common/single.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ blockquote {
}
}

.emphasis-point {
font-weight: normal;
text-emphasis: '';
-webkit-text-emphasis: '';
-moz-text-emphasis: '';
text-emphasis-position: under;
-webkit-text-emphasis-position: under;
-moz-text-emphasis-position: under;
}

.drop-cap {
float: left;
font-size: $fontSize * 3 + 2px;
Expand Down Expand Up @@ -207,33 +197,8 @@ pre {
padding: 0;
}
}
.highlight {
font-size: 0.8em;
margin: ($fontSize * 2) 0;
pre {
margin: 0 !important;
overflow: auto hidden;
background-color: unset;
}
th, td {
font-size: inherit;
}
table > tbody > tr:nth-of-type(odd) {
background-color: inherit;
}
table > tbody > tr:hover {
background-color: inherit;
}
}
span.lnt {
user-select: none;
display: block;
margin-right: -1em !important;
padding: 0 !important;
text-align: right;
}

.katex-display, mjx-container[jax="CHTML"][display="true"] {
overflow: auto hidden;
text-indent: 0;
}
}
4 changes: 4 additions & 0 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@
}
}
{{ end }}
{{ if .Site.Params.enableEmphasisPoint }}
@import "_common/emphasis-point.scss";
{{ end }}

{{ if .Site.Params.enableParagraphIndent }}
@import "_common/indent.scss";
Expand Down Expand Up @@ -322,6 +325,7 @@
}

{{ if .Site.Params.enableHighlight }}
@import "_common/highlight.scss";
@import "_common/_highlight/light.scss";
.chroma {
color: var(--color-contrast-high);
Expand Down
Loading

0 comments on commit bd6ca2b

Please sign in to comment.