Skip to content

Commit

Permalink
vaev-render, vaev-style: Initial support for page and page margin rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Dec 6, 2024
1 parent 279781b commit e08c96d
Show file tree
Hide file tree
Showing 20 changed files with 881 additions and 96 deletions.
105 changes: 105 additions & 0 deletions samples/page-margins.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<html xmlns="http://www.w3.org/1999/xhtml">

<style>
@page {
margin: 3cm;

/* MARK: Top ------------------------------------------------------------ */

@top-left-corner {
content: "Corner";
background-color: red;
}

@top-left {
content: "Left";
background-color: green;
}

@top-center {
content: "Center";
background-color: blue;
}

@top-right {
content: "Right";
background-color: green;
}

@top-right-corner {
content: "Corner";
background-color: red;
}

/* MARK: Bottom --------------------------------------------------------- */

@bottom-left-corner {
content: "Corner";
background-color: red;
}

@bottom-left {
content: "Left";
background-color: green;
}

@bottom-center {
content: "Center";
background-color: blue;
}

@bottom-right {
content: "Right";
background-color: green;
}

@bottom-right-corner {
content: "Corner";
background-color: red;
}

/* MARK: Left ----------------------------------------------------------- */

@left-top {
content: "Top";
background-color: green;
}

@left-middle {
content: "Middle";
background-color: blue;
}

@left-bottom {
content: "Bottom";
background-color: green;
}

/* MARK: Right ---------------------------------------------------------- */

@right-top {
content: "Top";
background-color: green;
}

@right-middle {
content: "Middle";
background-color: blue;
}

@right-bottom {
content: "Bottom";
background-color: green;
}
}
</style>

<body>
<h1>Lorem ipsum dolor, sit amet...</h1>
<p>
...consectetur adipisicing elit. Ab sunt aliquid voluptates fuga, autem earum minus
debitis temporibus ut facilis reprehenderit voluptatum maiores ipsum quis totam esse nemo sint minima.
</p>
</body>

</html>
5 changes: 3 additions & 2 deletions src/libs/karm-io/traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ template <typename T>
concept SeekableDuplexable = Duplexable<T> and Seekable<T>;

struct Writer {

virtual ~Writer() = default;

virtual Res<usize> write(Bytes) = 0;
Expand Down Expand Up @@ -89,7 +88,9 @@ struct TextWriter :

virtual Res<usize> writeRune(Rune rune) = 0;

Res<usize> flush() override { return Ok(0uz); }
Res<usize> flush() override {
return Ok(0uz);
}
};

template <StaticEncoding E = typename Sys::Encoding>
Expand Down
5 changes: 5 additions & 0 deletions src/web/vaev-base/page.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

namespace Vaev {

} // namespace Vaev
Loading

0 comments on commit e08c96d

Please sign in to comment.