Skip to content

Commit

Permalink
Remove CSS work-around from Remark plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
astefanutti committed Nov 4, 2023
1 parent fffb4fd commit 3758c4e
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions plugins/remark.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,6 @@ class Remark {
typeof remark === 'object' && typeof slideshow === 'object');
}

async configure() {
await this.page.evaluate(_ => {
for (let j = 0; j < document.styleSheets.length; j++) {
const sheet = document.styleSheets[j];
if (!sheet.rules) continue;
for (let i = sheet.rules.length - 1; i >= 0; i--) {
if (sheet.rules[i] instanceof window.CSSPageRule) {
sheet.deleteRule(i);
}
}
}
// Add a style to adjust for PDF export
const style = document.createElement('style');
document.head.appendChild(style);
style.sheet.insertRule(`
@media screen {
.remark-slide {
/* Default 'table' diplay does not work with Chrome PDF export */
display: inline-table;
}
.remark-slide-content {
display: table-cell;
}
.remark-slide-scaler {
/* Remove slides box shadows */
box-shadow: none;
}
}`);
});
}

size() {
return this.page.evaluate(_ => {
const [referenceWidth, referenceHeight] = [908, 681];
Expand Down

0 comments on commit 3758c4e

Please sign in to comment.