Skip to content

Default text style

For professional documents, it is important to maintain consistent typography. At the same time, documents that contain many text elements (e.g. reports) may become troublesome to configure, even with techniques such as global text styles or DSL extensions (creating more complex structures defined as C# extension methods).

This element allows you to override text styles in all its children at once.

.DefaultTextStyle(x => x.Bold().Underline())
.Column(column =>
    column.Item().Text("Default style applies to all children");
    column.Item().Text("You can override certain styles").Underline(false).FontColor(Colors.Green.Darken2);
    column.Item().PaddingTop(10).Border(1).Grid(grid =>

        foreach (var i in Enumerable.Range(1, 16))
                .FontSize(16 + i / 4);   

Please note that this element extends existing styles with additional configuration. Those styles can be extended/overridden in later stages of the code.


Released under the MIT License