Structs§
- Float
Value - Wrapper around an f32 value that is internally casted to an isize, in order to provide hash-ability (to avoid numerical instability).
- Percentage
Value - Wrapper around FloatValue, represents a percentage instead
of just being a regular floating-point value, i.e
5=5%
Enums§
- Option
Percentage Value - Percentage
Parse Error - Percentage
Parse Error Owned - Size
Metric - Enum representing the metric associated with a number (px, pt, em, etc.)
Constants§
- FP_
PRECISION_ MULTIPLIER - Multiplier for floating point accuracy. Elements such as px or %
are only accurate until a certain number of decimal points, therefore
they have to be casted to isizes in order to make the f32 values
hash-able: Css has a relatively low precision here, roughly 5 digits, i.e
1.00001 == 1.0 - FP_
PRECISION_ MULTIPLIER_ CONST
Functions§
- parse_
float_ value - parse_
percentage_ value - Parse “1.2” or “120%” (similar to parse_pixel_value)