Open mousetail opened 4 years ago
Related to #264.
AFAIU, these units are supposed to be relative to page area of the first page.
https://www.w3.org/TR/css-page-3/#page-model
The content area of a page box is called the page area. The content of the document is flowed into one or more page boxes. The page area acts as a container for all the boxes generated by the root element and its descendants that are laid out within a given page box. The edges of the page area on the first page establish the rectangle that is the initial containing block of the document.
https://www.w3.org/TR/css-values-3/#viewport-relative-lengths
vw unit, Equal to 1% of the width of the initial containing block.
vh unit, Equal to 1% of the height of the initial containing block.
AFAIU, these units are supposed to be relative to page area of the first page.
Good to know!
If a size property declaration is qualified by a width, height, device-width, device-height, aspect-ratio, device-aspect-ratio or orientation media query (or other conditional on the size of the paper), then the declaration must be ignored.
So I suspect that vw/vh is ignored in page size
.
🤔 I have a hard time trying to parse the sentences you quoted :) but I guess are are right.
🤔 I have a hard time trying to parse the sentences you quoted :) but I guess are are right.
Do you mean that CSS is easier to parse than its specification? 😄
Currently (v51), using
vw
orvh
gives a "invalid value" error. These units would be very useful to style elements relative to the page size. The W3 spec are unclear about the role ofvw
andvh
in paged media, where the CSS units spec refers to the paged media spec which contains no reference to these units. However, I feel like making the units work relative tot the page would be the most useful.