Browse Source

Remove accessible slide status when printing to PDF

master
quilicicf 2 years ago
parent
commit
ffac5fe696
No known key found for this signature in database GPG Key ID: 561A23A57B55DE1
  1. 5
      css/print/pdf.scss
  2. 5
      dist/print/pdf.css
  3. 2
      dist/reveal.css
  4. 2
      dist/reveal.min.js
  5. 4
      js/reveal.js

5
css/print/pdf.scss

@ -164,4 +164,9 @@ html.print-pdf {
position: absolute;
font-size: 14px;
}
/* This accessibility tool is not useful in PDF and breaks it visually */
.aria-status {
display: none;
}
}

5
dist/print/pdf.css

@ -9,7 +9,8 @@ html.print-pdf {
/* Slide backgrounds are placed inside of their slide when exporting to PDF */
/* Display slide speaker notes when 'showNotes' is enabled */
/* Layout option which makes notes appear on a separate page */
/* Display slide numbers when 'slideNumber' is enabled */ }
/* Display slide numbers when 'slideNumber' is enabled */
/* This accessibility tool is not useful in PDF and breaks it visually */ }
html.print-pdf * {
-webkit-print-color-adjust: exact; }
html.print-pdf {
@ -122,3 +123,5 @@ html.print-pdf {
display: block;
position: absolute;
font-size: 14px; }
html.print-pdf .aria-status {
display: none; }

2
dist/reveal.css

@ -1,5 +1,5 @@
/*!
* reveal.js 4.0.0-dev (Wed Mar 11 2020)
* reveal.js 4.0.0-dev (Thu Mar 12 2020)
* https://revealjs.com
* MIT licensed
*

2
dist/reveal.min.js

File diff suppressed because one or more lines are too long

4
js/reveal.js

@ -292,8 +292,6 @@ export default function( revealElement, options ) {
statusElement.style.position = 'absolute';
statusElement.style.height = '1px';
statusElement.style.width = '1px';
statusElement.style.top = '-1px';
statusElement.style.left = '-1px';
statusElement.style.overflow = 'hidden';
statusElement.style.clip = 'rect( 1px, 1px, 1px, 1px )';
statusElement.classList.add( 'aria-status' );
@ -370,7 +368,7 @@ export default function( revealElement, options ) {
// Limit the size of certain elements to the dimensions of the slide
createStyleSheet( '.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' );
document.querySelector('html').classList.add( 'print-pdf' );
document.documentElement.classList.add( 'print-pdf' );
document.body.style.width = pageWidth + 'px';
document.body.style.height = pageHeight + 'px';

Loading…
Cancel
Save