Make enter on 'Click here to print' work. Style tab outline better.

Issue #10
This commit is contained in:
Ian Gulliver
2018-12-02 06:13:54 +00:00
parent 2fd04e2618
commit c6e642e93a
2 changed files with 27 additions and 5 deletions

View File

@@ -75,6 +75,7 @@ overview,product {
a { a {
margin-bottom: 1em; margin-bottom: 1em;
padding: 0.2em;
max-width: 40em; max-width: 40em;
text-decoration: none; text-decoration: none;
color: black; color: black;
@@ -86,8 +87,10 @@ overview,product {
border: 0; border: 0;
border-bottom: black 1px dotted; border-bottom: black 1px dotted;
margin-top: 0; margin-top: 0.2em;
margin-bottom: 1em; margin-bottom: 0.2em;
padding: 0.2em;
} }
input:focus { input:focus {
@@ -112,6 +115,20 @@ overview,product {
text-align: center; text-align: center;
} }
button {
/* ugly hack to give the focus box breathing room without moving the text */
position: relative;
left: -0.2em;
padding: 0.2em;
border: none;
background: none;
font-family: inherit;
font-size: inherit;
font-weight: bold;
}
ol { ol {
box-sizing: border-box; box-sizing: border-box;
max-width: 40em; max-width: 40em;
@@ -121,11 +138,17 @@ overview,product {
ol > li { ol > li {
margin-bottom: 1em; margin-bottom: 1em;
padding: 0.1em;
} }
.selected { .selected {
font-weight: 600; font-weight: 600;
} }
*:focus {
outline: none;
box-shadow: 0 0 2pt 1pt maroon;
}
} }
@media print { @media print {

View File

@@ -65,9 +65,8 @@ class PassMate {
this.addElement('li', printreqs, 'Layout/Orientation: Landscape'); this.addElement('li', printreqs, 'Layout/Orientation: Landscape');
this.addElement('li', printreqs, 'Two-sided: Long edge (or just enabled)'); this.addElement('li', printreqs, 'Two-sided: Long edge (or just enabled)');
let printStep = this.addElement('li', instr, 'Click here to print the book!'); let printStep = this.addElement('li', instr);
printStep.style.fontWeight = 'bold'; let print = this.addElement('button', printStep, 'Click here to print the book!');
printStep.style.cursor = 'pointer';
printStep.addEventListener('click', () => { printStep.addEventListener('click', () => {
window.print(); window.print();
}); });