Skip to content

[Bug] Importing reveal js called print style breaking #3348

@Mister-Hope

Description

@Mister-Hope

This is caused by https://github.com/hakimel/reveal.js/blob/master/css/print/paper.scss

Even if I embed reveal.js in a page, it will override ALL THE BASIC ELEMENTS with !important, e.g.:

@media print {
html:not(.print-pdf) {

body, p, td, li {
font-size: 20pt!important;
color: #000;
}
h1,h2,h3,h4,h5,h6 {
color: #000!important;
height: auto;
line-height: normal;
text-align: left;
letter-spacing: normal;
}
/* Need to reduce the size of the fonts for printing */
h1 { font-size: 28pt !important; }
h2 { font-size: 24pt !important; }
h3 { font-size: 22pt !important; }
h4 { font-size: 22pt !important; font-variant: small-caps; }
h5 { font-size: 21pt !important; }
h6 { font-size: 20pt !important; font-style: italic; }

This means that output will have

@media print {
  html:not(.print-pdf) body {
      font-size: 20pt!important;
  }

  html:not(.print-pdf) h1 { 
    font-size: 28pt !important;
   }
}

So a normal page without reveal js like this:

image

Becomes like this just because reveal style is imported:

image

(I embed a reveal.js in page:)

image


My confusion is why is that file needed as users are already asked to print with ?print-pdf?

Also does anyone have the same confusion with me why reveal.js tries and why it should use high priority selectors and !important to force overriding default tag style?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions