ZIm/crates/ui/src
Marshall Bowers 404adbce5b
Encode rem values derived from pixels using rems_from_px (#9367)
This PR adds a new `rems_from_px` helper function that can be used to
compute rem values based on a pixel value.

This is something we do fairly commonly, where we want to express a size
that is a given pixel size at the base rem size (e.g., "14px when the
rem size is 16px").

`rems_from_px` helps make the intent more explicit, as well as prevent
the base rem size from being duplicated everywhere.

Note: Ideally we would want `rems_from_px` to be `const`, but that
depends on https://github.com/rust-lang/rust/issues/57241.

Release Notes:

- N/A
2024-03-14 16:39:55 -04:00
..
components Encode rem values derived from pixels using rems_from_px (#9367) 2024-03-14 16:39:55 -04:00
styles Encode rem values derived from pixels using rems_from_px (#9367) 2024-03-14 16:39:55 -04:00
utils ui: Fix doc tests (#3989) 2024-01-09 16:56:28 -05:00
clickable.rs Document ui crate traits 2024-01-09 14:15:25 -05:00
components.rs Use the already existing styles/typography for Headline 2024-01-05 15:59:34 -05:00
disableable.rs Fix possessive "its" in docs and comments (#3998) 2024-01-10 10:09:48 -05:00
fixed.rs Document ui crate traits 2024-01-09 14:15:25 -05:00
prelude.rs Encode rem values derived from pixels using rems_from_px (#9367) 2024-03-14 16:39:55 -04:00
selectable.rs Clean up references in doc comments in ui and theme crates (#3985) 2024-01-09 15:22:36 -05:00
styled_ext.rs Fix flickering (#9012) 2024-03-11 10:45:57 +01:00
styles.rs Remove 2 suffix for ui, storybook, text 2024-01-03 12:33:51 -08:00
ui.rs Document UI modules 2024-01-09 12:57:12 -05:00
utils.rs Document UI modules 2024-01-09 12:57:12 -05:00
visible_on_hover.rs Remove 2 suffix for ui, storybook, text 2024-01-03 12:33:51 -08:00