Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative length units such as em and vw used in CSS calc() not working correctly #968

Closed
MurakamiShinyu opened this issue Jul 30, 2022 · 0 comments · Fixed by #972
Closed
Assignees
Labels
bug P1 Priority 1: Required for MVP (Minimum Viable Product) spec conformance

Comments

@MurakamiShinyu
Copy link
Member

Test sample: https://gist.githubusercontent.com/MurakamiShinyu/f772284cdbf360387b0933a6474e5978/raw/em-and-vw-units-in-calc.html

<style>
@page {
  size: 50rem 50rem;
  margin: 5rem;
  outline: 1px dotted;
}
body {
  font-size: 200%;
}
p {
  outline: 1px solid; 
}
</style>
<p style="width: 20em">width: 20em</p>
<p style="width: calc(20em)">width: calc(20em)</p>
<p style="width: 20rem">width: 20rem</p>
<p style="width: calc(20rem)">width: calc(20rem)</p>
<p style="width: 50vw">width: 50vw</p>
<p style="width: calc(50vw)">width: calc(50vw)</p>
<p style="width: 50pvw">width: 50pvw</p>
<p style="width: calc(50pvw)">width: calc(50pvw)</p>

Test with Vivliostyle Viewer (v2.17.0): https://vivliostyle.github.io/viewer/v2.17.0/#src=https://gist.githubusercontent.com/MurakamiShinyu/f772284cdbf360387b0933a6474e5978/raw/em-and-vw-units-in-calc.html

Screen Shot 2022-07-30 at 22 20 38

In this test, width: calc(…) should be same as width: … (without calc()) but in the test result, width: calc(…) other than calc(20rem) are incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P1 Priority 1: Required for MVP (Minimum Viable Product) spec conformance
Projects
None yet
1 participant