floem icon indicating copy to clipboard operation
floem copied to clipboard

`DesignSystem` improvements

Open charlescgs opened this issue 3 months ago • 8 comments

This PR is making an effort to improve upon existing DesignSystem.

  • Set up lightness and muted parameters on per theme basis instead relying on hard-coded values
  • Add some documentation
  • Add hsl helper function

charlescgs avatar Nov 11 '25 05:11 charlescgs

Bumped to 1.90 as floor was constified at this rust version.

charlescgs avatar Nov 16 '25 19:11 charlescgs

Hmm. I thought that this would improve the performance of the style pass but it doesn't actually seem to make a difference.

What was the motivation for this change?

There is a regression on disabled text color

jrmoulton avatar Nov 17 '25 11:11 jrmoulton

image

jrmoulton avatar Nov 17 '25 11:11 jrmoulton

While we use Color that is just an alias for AlphaColor<Srgb> that is all I can do.

Styles in most places accept a Brush which can be any color space (or a gradient/image)

jrmoulton avatar Nov 17 '25 11:11 jrmoulton

The motivation was to make it do more work at compile time instead of runtime, but if its not making a difference then yeah, feel free to close it.

charlescgs avatar Nov 17 '25 11:11 charlescgs

I think all of the clippy if let chains would be good to merge. Maybe let's just revert the changes to theme.rs

jrmoulton avatar Nov 17 '25 11:11 jrmoulton

Will do that. However, will keep hsl function as an alternative way of constructing color, which might be useful when you are trying your theme out. Will add also a way to customize background elevation level.

charlescgs avatar Nov 17 '25 11:11 charlescgs

@jrmoulton PR is ready for review.

charlescgs avatar Nov 17 '25 20:11 charlescgs