I'm developing a library for application, tools and in-game user interfaces.
Currently it supports a mixture of retained-mode (Qt style) and immediate-mode (ImGui style) construction.
Layout is akin to the CSS box-model with inline, block and floated elements.
Transformation and clipping can be performed on the CPU-side to avoid splitting up draw-calls with vkCmdSetScissor or setting uniforms or push constants.
A range of effects are supported, such as drop shadows (analytic shader and geometric) and Gaussian blur, and I'm working on an efficient compositor that will cache unchanged regions into VkImages.
You can specify sizes in physical units (optionally DPI scaling aware) or explicit pixels when requested.
An interesting related topic is the automatic synthesis of layout engines specified by relational constraints, where a hypergraph (vertices = attributes, edges = functions) is used to encode function dependencies (see this paper https://www2.eecs.berkeley.edu/Pubs/T.... These can be more optimal, reliable and consistent than hand-written layout engines.
Also see https://lmeyerov.github.io/projects/p... - "The CSS layout standard is informally written, cross-cutting, does not provide insight into even the na¨ıve implementation of a correct engine, and underspecifies many features. As a result, designer productivity is limited by having to work around functionally incorrect engine implementations. Troubling, there are also standards-compliant feature implementations with functionally inconsistent interpretations between browsers."
Also, have you noticed your monitor reports very slightly different DPI for each dimension? Mine does. I measured physically and confirmed that after just above 300 pixels you're out by about 1mm which is slightly worrying considering that we assume square pixel aspect ratio when we build our projection matrices (or display any image / video). A monitor aspect ratio of 16:9 is very different if your pixel aspect ratio is not exactly 1:1. It also seems difficult to query display subpixel geometry, which is useful when performing subpixel-aware antialiasing (for 3D rendering and font rendering).
Join me down these rabbit holes at a later date.