Skip to content

Commit 3a643ab

Browse files
author
Ludwig Schubert
committed
Style fixes; moving away from contain: content to avoid cutting off hover boxes.
1 parent d0463ff commit 3a643ab

File tree

14 files changed

+57
-32
lines changed

14 files changed

+57
-32
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"url": "https://github.com/distillpub/distill-template/issues"
1313
},
1414
"scripts": {
15-
"start": "rollup -c rollup.config.dev.js -w",
15+
"dev": "rollup -c rollup.config.dev.js -w",
1616
"serve": "python3 -m http.server --bind 127.0.0.1 8888",
1717
"test": "mocha",
1818
"lint": "eslint",

src/components/d-appendix.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Template } from '../mixins/template';
2-
import { body } from '../helpers/layout';
32

43
const T = Template('d-appendix', `
54
<style>
65
76
d-appendix {
8-
contain: content;
7+
contain: layout style;
98
font-size: 0.8em;
109
line-height: 1.7em;
1110
margin-top: 60px;

src/components/d-citation-list.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { bibliography_cite } from '../helpers/citation';
22

33
const styles = `
44
d-citation-list {
5-
contain: content;
6-
overflow: hidden;
5+
contain: layout style;
76
}
87
98
d-citation-list .references {

src/components/d-cite.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ d-hover-box {
3838
margin-top: 1.9em;
3939
}
4040
41+
ul {
42+
margin: 0;
43+
padding: 0;
44+
list-style-type: none;
45+
}
46+
47+
ul li {
48+
padding: 15px 10px 15px 10px;
49+
border-bottom: 1px solid rgba(0,0,0,0.1)
50+
}
51+
52+
ul li:last-of-type {
53+
border-bottom: none;
54+
}
55+
4156
</style>
4257
4358
<d-hover-box id="hover-box"></d-hover-box>
@@ -106,7 +121,9 @@ export class Cite extends T(HTMLElement) {
106121

107122
set entries(entries) {
108123
if (this.hoverBox) {
109-
this.hoverBox.innerHTML = entries.map(hover_cite).join('<br><br>');
124+
this.hoverBox.innerHTML = `<ul>
125+
${entries.map(hover_cite).map(html => `<li>${html}</li>`).join('\n')}
126+
</ul>`;
110127
}
111128
}
112129

src/components/d-footnote-list.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ const T = Template('d-footnote-list', `
44
<style>
55
66
d-footnote-list {
7-
contain: content;
8-
overflow: hidden;
7+
contain: layout style;
98
}
109
1110
d-footnote-list > * {

src/components/d-hover-box.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ const T = Template('d-hover-box', `
2020
2121
.panel {
2222
position: absolute;
23+
font-size: 1rem;
24+
line-height: 1.5em;
2325
top: 0;
2426
left: 0;
2527
width: 100%;
2628
border: 1px solid rgba(0, 0, 0, 0.1);
2729
background-color: rgb(250, 250, 250);
2830
box-shadow: 0 0 7px rgba(0, 0, 0, 0.1);
2931
border-radius: 4px;
30-
padding: 10px;
3132
box-sizing: border-box;
3233
}
3334
34-
3535
</style>
3636
3737
<div class="container">

src/components/d-toc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function renderTOC(element, headings) {
2020
<style>
2121
2222
d-toc {
23-
contain: content;
23+
contain: layout style;
2424
display: block;
2525
}
2626

src/distill-components/distill-appendix.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { serializeFrontmatterToBibtex } from '../helpers/bibtex';
33
const styles = `
44
<style>
55
distill-appendix {
6-
contain: content;
7-
overflow: hidden;
6+
contain: layout style;
87
}
98
109
distill-appendix .citation {

src/distill-components/distill-header.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,14 @@ distill-header .nav a {
7272
${logo}
7373
Distill
7474
</a>
75-
<div class="nav">
75+
<nav class="nav">
7676
<a href="/about/">About</a>
7777
<a href="/prize/">Prize</a>
7878
<a href="/journal/">Submit</a>
79-
</div>
79+
</nav>
8080
</div>
8181
`, false);
8282

83-
// <div class="nav">
84-
// <a href="https://github.com/distillpub">GitHub</a>
85-
// <!-- https://twitter.com/distillpub -->
86-
// </div>
8783

8884
export class DistillHeader extends T(HTMLElement) {
8985

src/helpers/citation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export function bibliography_cite(ent, fancy){
146146
export function hover_cite(ent){
147147
if (ent){
148148
var cite = '';
149-
cite += '<b>' + ent.title + '</b>';
149+
cite += '<strong>' + ent.title + '</strong>';
150150
cite += link_string(ent);
151151
cite += '<br>';
152152

0 commit comments

Comments
 (0)