lightningcss
lightningcss copied to clipboard
Support page margin boxes
https://www.quackit.com/css/at-rules/what_is_a_page-margin_box_in_css.cfm
E.g.
@page {
size: A4;
margin: 10%;
@top-left-corner { /* <---- */
content: "Page " counter(page);
}
}
currently results in Unknown at rule: @top-left-corner
Thanks for reporting this @mischnic for me.
In the same file where I experience this I also have a weird bug with a 0 value. This seems to be ignored in parcel-css and I get huge margins, when I change them to 0.01px
it renders more correct.
@media print {
@page :first {
margin-top: 0px;
margin-left: 0px;
margin-bottom: 0px;
margin-right: 0px;
}
}
hmm, afaik unitless zero lengths are valid. What software are you using to render? A browser, or something else?
currently results in
Unknown at rule: @top-left-corner
Same here. We use an HTML-to-PDF converter that uses these @-rules. We would like to use parcel for building our templates, but the current limitations prevent us from doing so.
Trying to build:
@page {
margin-top: 72px;
@top-center {
content: "test";
}
@top-right {
content: "test2";
}
}
Results in
@parcel/transformer-css: Unknown at rule: @top-center