Open trueNAHO opened 7 months ago
This could make use of black box types, which will be introduced by #102, to allow syntax like:
fonts.sizes.applications = config.lib.stylix.types.size.from.points 12
config.stylix.fonts.sizes.applications.as.pixels
config.stylix.fonts.sizes.applications.as.points
See here for the library function which implements this.
The
config.stylix.fonts.sizes
attribute set should be extended to support thepixel
andpoint
units due to various applications supporting different units.Each
exact
value of thepixel
andpoint
units should have a complementaryrounded
value to account for the1 point = (4 / 3) pixels
conversion introducing floating point numbers. For reference, numbers can be efficiently rounded withnumber: builtins.floor (number + 0.5)
.To avoid inconsistencies, an assertion should verify that only one of the
pixel
andpoint
units is set by the end user.Related: https://github.com/danth/stylix/pull/239#issuecomment-1931862955