@xiee/utils 1.11.1 → 1.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/default.css +16 -29
- package/css/default.min.css +1 -1
- package/js/appendix.js +15 -1
- package/js/appendix.min.js +1 -1
- package/package.json +1 -1
package/css/default.css
CHANGED
|
@@ -8,24 +8,16 @@ body {
|
|
|
8
8
|
}
|
|
9
9
|
body, .footnotes, code { font-size: .9em; }
|
|
10
10
|
li li { font-size: .95em; }
|
|
11
|
-
*, *:before, *:after {
|
|
12
|
-
box-sizing: inherit;
|
|
13
|
-
}
|
|
11
|
+
*, *:before, *:after { box-sizing: inherit; }
|
|
14
12
|
pre, img { max-width: 100%; }
|
|
15
|
-
pre, pre:hover {
|
|
16
|
-
|
|
17
|
-
word-break: break-all;
|
|
18
|
-
}
|
|
19
|
-
pre code {
|
|
20
|
-
display: block;
|
|
21
|
-
overflow-x: auto;
|
|
22
|
-
}
|
|
13
|
+
pre, pre:hover { white-space: pre-wrap; word-break: break-all; }
|
|
14
|
+
pre code { display: block; overflow-x: auto; }
|
|
23
15
|
code { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }
|
|
24
|
-
:not(pre) > code, code[class] { background-color: #f8f8f8; }
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
16
|
+
:not(pre) > code, code[class], .box > div { background-color: #f8f8f8; }
|
|
17
|
+
pre > code:not([class]), pre > .language-plain, .box { background-color: inherit; border: 1px solid #eee; }
|
|
18
|
+
pre > .message { border-color: #9eeaf9; }
|
|
19
|
+
pre > .warning { background: #fff3cd; border-color: #fff3cd; }
|
|
20
|
+
pre > .error { background: #f8d7da; border-color: #f8d7da; }
|
|
29
21
|
.fenced-chunk { border-left: 1px solid #666; }
|
|
30
22
|
.code-fence {
|
|
31
23
|
opacity: .4;
|
|
@@ -33,10 +25,12 @@ code.language-undefined, pre > code:not([class]) {
|
|
|
33
25
|
border-left: 2px solid;
|
|
34
26
|
}
|
|
35
27
|
.code-fence:hover { opacity: inherit; }
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
28
|
+
.box { margin: 1em 0; }
|
|
29
|
+
.box > :first-child > p:first-child, .box > :last-child > p:last-child { padding: 1em; }
|
|
30
|
+
.box > :first-child, .box > :first-child > p:first-child { margin-top: 0; }
|
|
31
|
+
.box > :last-child, .box > :last-child > p:last-child { margin-bottom: 0; }
|
|
32
|
+
.figure > p { text-align: center; }
|
|
33
|
+
table { margin: auto; border-top: 1px solid #666; }
|
|
40
34
|
table thead th { border-bottom: 1px solid #ddd; }
|
|
41
35
|
th, td { padding: 5px; }
|
|
42
36
|
thead, tfoot, tr:nth-child(even) { background: #eee; }
|
|
@@ -55,17 +49,10 @@ table, .body h2 { border-bottom: 1px solid #666; }
|
|
|
55
49
|
.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }
|
|
56
50
|
.footnote-ref a::before { content: "["; }
|
|
57
51
|
.footnote-ref a::after { content: "]"; }
|
|
58
|
-
section.footnotes::before {
|
|
59
|
-
content: "";
|
|
60
|
-
display: block;
|
|
61
|
-
max-width: 20em;
|
|
62
|
-
}
|
|
52
|
+
section.footnotes::before { content: ""; display: block; max-width: 20em; }
|
|
63
53
|
|
|
64
54
|
@media print {
|
|
65
|
-
body {
|
|
66
|
-
font-size: 12pt;
|
|
67
|
-
max-width: 100%;
|
|
68
|
-
}
|
|
55
|
+
body { font-size: 12pt; max-width: 100%; }
|
|
69
56
|
tr, img { page-break-inside: avoid; }
|
|
70
57
|
}
|
|
71
58
|
@media only screen and (min-width: 992px) {
|
package/css/default.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
body{font-family:sans-serif;max-width:800px;margin:auto;padding:1em;line-height:1.5;box-sizing:border-box}.footnotes,body,code{font-size:.9em}li li{font-size:.95em}*,:after,:before{box-sizing:inherit}img,pre{max-width:100%}pre,pre:hover{white-space:pre-wrap;word-break:break-all}pre code{display:block;overflow-x:auto}code{font-family:'DejaVu Sans Mono','Droid Sans Mono','Lucida Console',Consolas,Monaco,monospace}
|
|
1
|
+
body{font-family:sans-serif;max-width:800px;margin:auto;padding:1em;line-height:1.5;box-sizing:border-box}.footnotes,body,code{font-size:.9em}li li{font-size:.95em}*,:after,:before{box-sizing:inherit}img,pre{max-width:100%}pre,pre:hover{white-space:pre-wrap;word-break:break-all}pre code{display:block;overflow-x:auto}code{font-family:'DejaVu Sans Mono','Droid Sans Mono','Lucida Console',Consolas,Monaco,monospace}.box>div,:not(pre)>code,code[class]{background-color:#f8f8f8}.box,pre>.language-plain,pre>code:not([class]){background-color:inherit;border:1px solid #eee}pre>.message{border-color:#9eeaf9}pre>.warning{background:#fff3cd;border-color:#fff3cd}pre>.error{background:#f8d7da;border-color:#f8d7da}.fenced-chunk{border-left:1px solid #666}.code-fence{opacity:.4;border:1px dashed #666;border-left:2px solid}.code-fence:hover{opacity:inherit}.box{margin:1em 0}.box>:first-child>p:first-child,.box>:last-child>p:last-child{padding:1em}.box>:first-child,.box>:first-child>p:first-child{margin-top:0}.box>:last-child,.box>:last-child>p:last-child{margin-bottom:0}.figure>p{text-align:center}table{margin:auto;border-top:1px solid #666}table thead th{border-bottom:1px solid #ddd}td,th{padding:5px}tfoot,thead,tr:nth-child(2n){background:#eee}blockquote{color:#666;margin:0;padding-left:1em;border-left:.5em solid #eee}.footnotes::before,hr{border:1px dashed #ddd}.frontmatter{text-align:center}#TOC .numbered li{list-style:none}#TOC .numbered{padding-left:0}#TOC .numbered ul{padding-left:1em}.body h2,table{border-bottom:1px solid #666}.appendix~h2,.body .appendix{border-bottom-style:dashed}.footnote-ref a::before{content:"["}.footnote-ref a::after{content:"]"}section.footnotes::before{content:"";display:block;max-width:20em}@media print{body{font-size:12pt;max-width:100%}img,tr{page-break-inside:avoid}}@media only screen and (min-width:992px){pre{white-space:pre}}
|
package/js/appendix.js
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
// find <h[1-6] class="appendix"> and
|
|
1
|
+
// find <h[1-6] class="appendix"> and either add the class 'appendix' to
|
|
2
|
+
// wrappers of appendix elements or create a new <div> next to the parent
|
|
2
3
|
// element to hold all appendix elements
|
|
3
4
|
(d => {
|
|
4
5
|
const h = d.querySelector([1, 2, 3, 4, 5, 6].map(i => `h${i}.appendix`).join(','));
|
|
5
6
|
if (!h) return;
|
|
6
7
|
h.classList.remove('appendix');
|
|
8
|
+
// if h is in a wrapper whose next sibling has the same class, simply add class to wrappers
|
|
9
|
+
const p1 = h.parentNode; let p2 = p1, wrapper = false;
|
|
10
|
+
while (p1) {
|
|
11
|
+
p2 = p2.nextElementSibling;
|
|
12
|
+
if (!p2 || p1.tagName !== p2.tagName || p1.className !== p2.className) break;
|
|
13
|
+
p2.classList.add('appendix');
|
|
14
|
+
wrapper = true;
|
|
15
|
+
}
|
|
16
|
+
if (wrapper) {
|
|
17
|
+
p1.classList.add('appendix');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
// create a new div instead
|
|
7
21
|
const a = d.createElement('div');
|
|
8
22
|
a.className = 'appendix';
|
|
9
23
|
a.append(h.cloneNode(true));
|
package/js/appendix.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(e=>{const
|
|
1
|
+
(e=>{const a=e.querySelector([1,2,3,4,5,6].map((e=>`h${e}.appendix`)).join(","));if(!a)return;a.classList.remove("appendix");const n=a.parentNode;let t=n,d=!1;for(;n&&(t=t.nextElementSibling,t&&n.tagName===t.tagName&&n.className===t.className);)t.classList.add("appendix"),d=!0;if(d)return void n.classList.add("appendix");const p=e.createElement("div");for(p.className="appendix",p.append(a.cloneNode(!0));a.nextSibling;)p.append(a.nextSibling);"BODY"===a.parentNode.tagName?e.body.append(p):a.parentNode.after(p),a.remove()})(document);
|