Skip to content

rem unit calculation does not vary for different base font sizes #3403

@bsweeney

Description

@bsweeney

When Dompdf performs rem calculations the calculated value does not appear to change with the font size applied to the root (HTML) element.

For example, changing the font size for the HTML element in the following document should adjust the size of the positioned DIV, but it does not.
 

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <style>
    @page {
      size: 400 400;
    }
    html {
      font-size: 10pt;
    }
    #rem {
      background-color: orange;
      position: absolute;
      inset: 10rem;
    }
  </style>
</head>
<body>
  <div id="rem"></div>
</body>
</html>

Originally posted in #3402

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions